1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

need to grep a string in a string

Discussion in 'Shell Script' started by kandarpa, Aug 28, 2010.

  1. kandarpa

    kandarpa New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi I am tryibg to check for presance of a string in a big string. I tried as follows:

    IS_VECTOR_TEST_CASE=`grep AIV "$PWD"`
    if [ "$IS_VECTOR_TEST_CASES" = "" ]
    then
    #do something
    else
    #do something
    fi
    This always giving me as if [ "$IS_VECTOR_TEST_CASES" = "" ] is true with following error:
    grep: /abc/bcd/cde/AIV/def: Invalid argument

    Please help me in this issue...
     

Share This Page