[clue-talk] Bash scripting question

Sean LeBlanc seanleblanc at comcast.net
Wed Nov 30 13:48:41 MST 2005


On 11-30 09:35, G. Richard Raab wrote:
> On Wednesday 30 November 2005 09:13, Sean LeBlanc wrote:
> > ssmtp -f me at me.com me at me.com me2 at me.com < msg
> >
> > Here's where I run into the problem: Can any bash/sh gurus tell me how I
> > can I construct the message without writing to external file? The stream of
> > msg needs to look like this:
> >
> > Subject: $1
> > $1
> 
> Next to google, you will find the man pages the most important things going.

Thanks. Yeah, the man pages are great - when you know what to search for,
which isn't always the case. I tried googling for some tutorials, but they
all do the usual stuff of showing redirection, variable assignment, etc.
Something I never knew I found out when browsing some of those: variables
cannot contain return characters.

In case you're interested, here's what I ended up doing:

#!/usr/local/bin/bash
/usr/local/sbin/ssmtp -f seanleblanc at comcast.net seanleblanc at comcast.net <<<
"From: seanleblanc at comcast.net
Subject: $1

$1"

-- 
Sean LeBlanc:seanleblanc at comcast.net  
First Law of Aviation: Takeoff is optional, landing compulsory. 
(contributed by Frank v Waveren) 



More information about the clue-talk mailing list