[Linux-disciples] echo

Chung-chieh Shan ccshan at post.harvard.edu
Tue Jan 10 11:57:12 EST 2006


On 2006-01-10T10:58:51-0500, Stephen R Laniel wrote:
> Is it just me, or is this odd?
> 
> (10:57) slaniel at TheloniousMonk:~$ echo "some \"stuff\""
> some "stuff"
> (10:57) slaniel at TheloniousMonk:~$ echo 'some \'stuff\''
> >
> 
> Shouldn't the quoting behavior be identical? I would think
> the shell would do a first pass over either line, strip off
> the single quotes, convert the escaped inner quotes into
> literal quotes, and echo. No?

info bash:

3.1.2.2 Single Quotes
.....................

Enclosing characters in single quotes (`'') preserves the literal value
of each character within the quotes.  A single quote may not occur
between single quotes, even when preceded by a backslash.

-- 
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
"Parentheses?  What parentheses? I haven't noticed any parentheses
since my first month of Lisp programming.  I like to ask people who
complain about parentheses in Lisp if they are bothered by all the
spaces between words in a newspaper..." -- Kenny Tilton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20060110/b800c281/attachment.pgp


More information about the Linux-disciples mailing list