Subject: Re: shell quoting problems
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: tech-userlevel
Date: 11/27/2002 18:06:52
[ On Wednesday, November 27, 2002 at 17:43:00 (-0500), Greg A. Woods wrote: ]
> Subject: Re: shell quoting problems
>
> [ On Wednesday, November 27, 2002 at 11:34:09 (+0000), David Laight wrote: ]
> > Subject: Re: shell quoting problems
> >
> > Maybe the \ should be removed on the initial parsing.  So:
> > 	echo "`echo \\\"`"
> > would be needed to get " output.
> 
> Yes, I think I would agree with that.
> 
> Interestingly KSH Version M-11/16/88i does that correctly with
> back-quotes (as it seems does SysVr4 /bin/sh) but not with $().

Duh.  Yes, of course!  It's supposed to be that way.

The use of $() triggers the dollar-sign-in-a-quoted-string rule, not the
back-quote-in-a-quoted-string rule.  No escape characters are supposed
to be removed within the $().
 
KSH "Version M 1993-12-28 n" (shells/ast-ksh) also conforms.

-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>