On Tue, Nov 13, 2007 at 03:32:39PM +0000, cs wrote: > Folks, I have a bash script and I wanted to be able to catch a situation > and then send an email to the user flagging this. However, the -s to > `mail` doesn't allow spaces and I cannot work out, despite several > attempts, how to escape/quote etc in order to do what I want. Here's > what I'd like to do:
maybe this might do it. > > #!/bin/bash -x > TEMPFILE=`mktemp /tmp/chk_procs_XXX` SUBJECT="$0 error" > trap "date|mail -s $SUBJECT [EMAIL PROTECTED];echo Error - aborting;\ > exit" ERR note the quote change in 'trap' A
signature.asc
Description: Digital signature