Re: Shell quoting
- From
Junio C Hamano <junkio@cox.net>
- Date
- Sep 15, 2005, 19:50 UTC
- Message-ID
- <7vll1yyusn.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <4329CC02.8090104@zytor.com>
"H. Peter Anvin" <hpa@zytor.com> writes:
Show 5 quoted lines
> Linus Torvalds wrote: >> Does anybody really still use tcsh? It's a broken mess. >> > > Yes.
Yes to "still use", or yes to "broken mess" ;-)?
Show 10 quoted lines
>> Junio's "sq_quote()" works wonderfully on any valid shells. The fact >> that tcsh expands ! even inside single quotes is just pure >> braindamage. > >> You could expand "sq_quote" to handle '!' and '\' characters the exact >> same way it handles the single tick (end single-tick quoting, do \! or \\ >> and start single-tick quoting again) and that might be good enough for >> tcsh. > > It seems easier to just \-escape any special characters.
I am sympathetic. The beauty of sq_quote() comes directly from the behaviour of single quoting rules of "any valid shells" -- there is no need to maintain a list of special characters. Just single quote itself is special and nothing else.