Re: [SLUG] stop processing with 'if grep exit' ?

2014-03-31 Thread lists
On Wed, March 19, 2014 5:43 pm, pe...@chubb.wattle.id.au wrote: Yes, but I'd use grep test2 file2 exit 0 Peter, thanks again. can I include somewhere here 'echo 'helo' $LOG' -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs:

Re: [SLUG] stop processing with 'if grep exit' ?

2014-03-31 Thread peter
lists == lists li...@sbt.net.au writes: lists On Wed, March 19, 2014 5:43 pm, pe...@chubb.wattle.id.au wrote: Yes, but I'd use grep test2 file2 exit 0 lists Peter, lists thanks again. can I include somewhere here 'echo 'helo' lists $LOG' Can't see why not. While testing, you can put

Re: [SLUG] stop processing with 'if grep exit' ?

2014-03-19 Thread peter
lists == lists li...@sbt.net.au writes: lists I have a script that runs like this [1]: can I insert another lists grep test 'stuff3' and, stop processing with an 'exit', between lists stuff and stuff2? Yes, but I'd use grep test2 file2 exit 0 Peter C -- SLUG - Sydney Linux User's

Re: [SLUG] stop processing with 'if grep exit' ?

2014-03-19 Thread lists
grep test2 file2 exit 0 Peter, thanks, I'll try that so, I could use multiple conditions like so: grep test2 file2 exit 0 grep test3 file2 exit 0 ? thanks -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs:

Re: [SLUG] stop processing with 'if grep exit' ?

2014-03-19 Thread Amos Shapira
If you want to grep for multiple strings in the same file, and exit if any of them is found, it is more efficient (and I think more maintainable) to specify them in one line: grep -q -e test2 -e test3 file2 exit 0 The -q is --quiet - just to suppress the output if you aren't interested in it

Re: [SLUG] stop processing with 'if grep exit' ?

2014-03-19 Thread Norman Gaywood
On 19 March 2014 22:23, Amos Shapira amos.shap...@gmail.com wrote: If you want to grep for multiple strings in the same file, and exit if any of them is found, it is more efficient (and I think more maintainable) to specify them in one line: grep -q -e test2 -e test3 file2 exit 0 I like

[SLUG] stop processing with 'if grep exit' ?

2014-03-18 Thread lists
I have a script that runs like this [1]: can I insert another grep test 'stuff3' and, stop processing with an 'exit', between stuff and stuff2? like these 3 lines in [2] marked '=' [1]- ..snip.. if [ -s /home/voytek/part2 ] ; then if grep -q stuff part2; then