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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice