[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] MacOSX email



On Thu, Oct 04, 2012 at 07:29:54AM +0000, Jewell, Chris wrote:
> A workaround, for now, is to create bash wrapper for the mailer:
> 
> #!/bin/bash
> 
> cat - | /usr/bin/mail $1 "$2" $3
> 
> exit 0
> 
> 
> Remarks:
> 
> 1)  The second command line argument must be enclosed in quotes, or the subject line get broken up.

Aside: the other args should be quoted too, because you never know when an
argument might contain a space.

A safer approach is to use this form:  /usr/bin/mail "$@"

"$@" (including the double quotes) expands to the list of parameters passed
to the script, each one properly quoted. That is, it's the same as
"$1" "$2" "$3" ... for as many parameters as the script has.