Subject: Re: fix for pd-ksh globbing
To: Simon J. Gerraty <sjg@crufty.net>
From: Greg A. Woods <woods@weird.com>
List: tech-userlevel
Date: 01/25/2002 14:07:46
[ On Friday, January 25, 2002 at 10:19:37 (-0800), Simon J. Gerraty wrote: ]
> Subject: Re: fix for pd-ksh globbing
>
> > It still freaks out when expanding files with meta-characters
> > (double-quotes, single-quotes, parenthesis). It expands the file,
> 
> Oops there was a bug in my patch which may have caused that.
> Here's the fixed version which I just sent off to the pdksh
> maintainer.

How about '#'?  Emacs creates temporary files beginning with '#'.  With
your patch I can expand them better, but using the result is still
impossible.  In particular even if I escape the leading '#' ksh will
remove my backslash!  Here's an example (using emacs mode, with my
keystrokes illustrated in angle brackets):

$ echo \#for*<CR>
#forward of cy_email@hanmail.net's note re: Çö±ÝÀÌ ÇÊ¿äÇϽʴϱî? Áö±Ý ½ÅûÇϼ¼¿ä..#23306uJm#
$ echo \#for<ESC><ESC>
$ echo #forward\ of\ cy_email@hanmail.net\'s\ note\ re:\ ^Çö±ÝÀÌ\ ^ÇÂÊ^^?Âä^ÇϽʴϱ^î?\ ^Áö±Ý\ ½ÂÅ^Ã^û^Çϼ¼^^?Âä..#23306uJm#<CR>
$ 



BTW, I don't know if it was intended or not, but your patch has the very
pleasant side-effect of allowing filname expansion within quoted strings
to work, which for the above example results in a correct string if
enclosed in double quotes, but not within single quotes (thus providing
a partial work-around for the un-escaped '#'s):

$ echo '#for<ESC><ESC>'
$ echo '#forward\ of\ cy_email@hanmail.net\'s\ note\ re:\ ^Çö±ÝÀÌ\ ^ÇÂÊ^^?Âä^ÇϽʴϱ^î?\ ^Áö±Ý\ ½ÂÅ^Ã^û^Çϼ¼^^?Âä..#23306uJm# ' 
>>> <DEL>
$ echo "#for<ESC><ESC>"
$ echo "#forward\ of\ cy_email@hanmail.net\'s\ note\ re:\ ^Çö±ÝÀÌ\ ^ÇÂÊ^^?Âä^ÇϽʴϱ^î?\ ^Áö±Ý\ ½ÂÅ^Ã^û^Çϼ¼^^?Âä..#23306uJm# "
#forward\ of\ cy_email@hanmail.net\'s\ note\ re:\ Çö±ÝÀÌ\ ÇÊ¿äÇϽʴϱî?\ Áö±Ý\ ½ÅûÇϼ¼¿ä..#23306uJm#
$ 

-- 
								Greg A. Woods

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