BASH script quote problem

Michael A. Cleverly michael at cleverly.com
Thu Nov 2 15:04:24 MST 2006


On 11/2/06, Scott Morris <scottmmorris at hotpop.com> wrote:
> I have this bash script, as follows:
>
> #!/bin/sh
> RECIP=scottmmorris at hotpop.com
> SUBJECT="Running on `hostname`"
> ls | mail -s ""$SUBJECT" - sent" "$RECIP"

Try

ls | mail -s "$SUBJECT - sent" $RECIP

or

ls | mail -s "\"$SUBJECT\" - sent" $RECIP

instead.

Michael



More information about the PLUG mailing list