954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

need to grep a string in a string

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...

kandarpa
Newbie Poster
12 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

echo "string" | grep "pattern"

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

Thnq Very much.........

kandarpa
Newbie Poster
12 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You