>>>>> "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
      exec 2> /tmp/alog$$
      set +x
near the start of the script to get a log of everything that happens
in a file in /tmp.  Get rid of the lines when you're sure it all works
though.

If you're doing that, then while testing if there are any lines that
you don't want to have their effect, but still want to see, put a
colon at the start.  : is a special command that does nothing --- but
lets you see what arguements would be expanded.

So
        if grep 'stuff3' somefile > /dev/null 2>&1
        then
        : mail -s "$someSubject" f...@nurk.org <<-EOF
        Some email message
        
        .
EOF
        fi

will show the mail command with someSubject exanded in the log, but
will not actually send any mail.

Peter C





lists> -- SLUG - Sydney Linux User's Group Mailing List -
lists> http://slug.org.au/ Subscription info and FAQs:
lists> http://slug.org.au/faq/mailinglists.html
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to