BASH script quote problem

Michael A. Cleverly michael at
Fri Nov 3 07:29:20 MST 2006

On 11/3/06, Alex Esplin <alex.esplin at> wrote:
> On 11/2/06, Michael A. Cleverly <michael at> wrote:
> > Or even:
> >
> > ls | mail -s "Running on $HOSTNAME - sent" $RECIP
> >
> > since $HOSTNAME is a bash built-in variable.
> That might not give quite the results the OP wanted, since $HOSTNAME
> returns the name of the host and not the OS running on said host.
> For example, on a Linux box here at work,
> "Running on $HOSTNAME" reads as: "Running on frogger", where as
> "Running on `uname -o`" reads as: "Running on GNU/Linux"
> Just my $.02 based on the statements in the original post.

The OP shows he was running `hostname`, not `uname -o`.  His box just
happens to be named suse-linux apparently.


More information about the PLUG mailing list