[gllug] echo

Richard Cohen vmlinuz at gmail.com
Wed Apr 20 08:29:50 UTC 2005


On 4/20/05, Steve Nelson <sanelson at gmail.com> wrote:
> Richard wrote:
> 
> > The point is that what you type isn't what gets sent to echo.  The
> > shell performs expansion *before* passing the command-line onto the
> > command....
> 
> Ah yes, of course.
> 
> Hence why it must be escaped or quoted.  Speaking of which, am I
> correct in remembering that if one quotes with " ", $ ' and \ retain
> their meaning, whereas all characters inside a pair of single quotes
> are assumed to have their literal value?

That's exactly the sort of thing I can never remember and never really
be bothered to remember, since 10 seconds testing will answer the
question :-)

bash-2.05b$ echo $SHELL
/bin/bash
bash-2.05b$ echo "$SHELL"
/bin/bash
bash-2.05b$ echo '$SHELL'
$SHELL

> S.

Cheers
Richard
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list