lolaferrari
asked on
bash script alternative to grep -v
if I have lots of grep -v in my shell script will it slow it down or is there are limit to how many I can put in egrep '(word|word2|word3) ? Is there a better way to do this ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Oh yes, silly me - maybe not the best example. The little script just hangs. Does the grep -f extract all the similar patterns found in file?
Yes, the -f option means grep is looking in a specified file for patterns.
When your script hangs, just call it explicitly with the -xv option, you'll get to see debugging information with variable assignments etc. This should help you finding out why the script is hanging.
For example:
bash -xv your_script
When your script hangs, just call it explicitly with the -xv option, you'll get to see debugging information with variable assignments etc. This should help you finding out why the script is hanging.
For example:
bash -xv your_script
how are you using grep in your script?
What are you 'greppinh' for then? A process list perhaps? Can you show an example?