How to place a comma in 'a{b,c,d}e' metanotation

Paul Falstad pfalstad at burst.Princeton.EDU
Fri Jan 25 06:48:46 AEST 1991


rouben at math9.math.umbc.edu () wrote:
>The csh man page explains how the metanotation "a{b,c,d}e" expands into
>"abe ace ade".  What it does not explain is how to place commas in the
>output, if necessary.  For instance I wish that the construction
>"a{b\,,c\,,d}" would expand to the comma separated list "ab, ac, ad",
>but it actually expands to "ab a ac a ad".  I guess I do not know how
>to escape the ',' character in these constructions.  Does anyone know how?

Apparently this is a bug in some versions of csh.  Our version (SunOS)
appears to have it fixed, but our version of tcsh (we don't have SunOS
source for csh) does not.  Apparently it can be fixed simply by
commenting out this line in sh.glob.c:

	case ','|QUOTE:

This is line 350 in my version of tcsh.  (Just grep for ','|QUOTE,
there's only one line remotely like that.)

Unless I'm stupid, there's no reason for that line to be there.  The
code looks like:

	case ','|QUOTE:
	case ',':
		... do the brace expansion ...

It looks like the author(s) went to extra effort to make , unquoteable.
Am I missing something or is it just a mistake?

--
Paul Falstad, pfalstad at phoenix.princeton.edu PLink:HYPNOS GEnie:P.FALSTAD
"And she's always on about men following her.  I don't know what she
thinks they're going to do to her.  Vomit on her, Basil, says."-Flowery Twats



More information about the Comp.unix.questions mailing list