Path: utzoo!attcan!uunet!glyph!nichiren From: nichiren@glyph.UUCP (Andy Heffernan) Newsgroups: comp.unix.questions Subject: Re: Strangeness in shell Message-ID: <470@glyph.UUCP> Date: 26 Jul 89 04:52:38 GMT References: <432@mccc.UUCP> <9700009@osiris.cso.uiuc.edu> <2277@auspex.auspex.com> Reply-To: nichiren@glyph.UUCP (Andy Heffernan) Organization: Elvis Needs Boats Lines: 34 In article <2277@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: >> Ummm... I had always learned (obviously flawed) that the single quotes >>prevented expansion of ANYTHING.... > [much deleted] > >>If you have no files ending in z , then why does it not return a null >>string for the '*z' version ? > >Because that's the way the Bourne shell works. If a filename pattern >doesn't match any file names, it is left unchanged, not expanded to a >null string or a null list. Yes, indeed. For a simple-minded example of this feature in action, we Bourne/Korn shell users can get away with: $ uucp whereever!~uucp/goodstuff/* ~uucp/cache to get everything in whereever's public goodstuff directory. Unless your current directory contains a directory named "whereever!~uucp" which contains a directory named "goodstuff", which in turn has some non-dot files in it, the first argument to the command will expand to itself, and so get passed to 'whereever' for expansion. For C-shell users, at least the * in the above command needs quoting against interpretation, and I guess the ! as well. (Beats me, I just ^P.) -- ------------------------------------------------------------------------- Andy Heffernan uunet!glyph!nichiren [1222 - 1282] ------------------------------------------------------------------------- "Dogpile on the rabbit! Dogpile on the rabbit!"