Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!wuarchive!zaphod.mps.ohio-state.edu!rpi!crdgw1!sixhub!davidsen From: davidsen@sixhub.UUCP (Wm E. Davidsen Jr) Newsgroups: comp.unix.sysv386 Subject: Re: SCO Unix ksh (file name expansion using {}) question Message-ID: <2774@sixhub.UUCP> Date: 31 Dec 90 04:53:30 GMT References: <1476@beaudin.UUCP> <1990Dec29.050118.4229@kithrup.COM> <1477@beaudin.UUCP> Reply-To: davidsen@sixhub.UUCP (bill davidsen) Organization: *IX Public Access UNIX, Schenectady NY Lines: 41 In article <1477@beaudin.UUCP> john@beaudin.UUCP (John Beaudin) writes: | I think it should work simply because there might be a script with the line | $ cp {$*} /tmp | which would fail if only 1 arg was passed via the command line. Besides, | it works ok in csh. That doesn't seem to work in csh, either, at least not here. Since $* uses a blank rather than comma delimiter, the list isn't replaced. Also, it has nothing to do with wildcard or filenames. The function in ksh is to replicate any argument which contains a comma delimited list enclosed in braces, with any stuff outside the braces but still in the same argumnt. Ex: $ echo a{b,c} ab ac $ echo {a,b{c,d}} a bc bd I see exactly the same output with csh. | Also, I've got Korn's book on ksh but can't find any reference to {} in | pathname expansion; nor in the ksh man page. Maybe it's undocumented | because it's a little buggy and not officially supported yet. Maybe it's because the comma delimited list you tried didn't have a comma in it. csh does not require the comma, nor does it allow use of braces without quoting. If you do "ls {foo}" you will miss the file "{foo}" and get the file "foo." I don't think you should say either is "wrong," They are slightly difirent, but in the usual case, where you want expansion of the list, they work the same. Many vendors of V.4 didn't enable this feature, a large loss in my opinion. -- bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen) sysop *IX BBS and Public Access UNIX moderator of comp.binaries.ibm.pc and 80386 mailing list "Stupidity, like virtue, is its own reward" -me