Strangeness in shell

David C Lawrence tale at pawl.rpi.edu
Fri Jul 28 09:47:38 AEST 1989


In article <TALE.89Jul22220358 at imagine.pawl.rpi.edu> I apparently wrote:
Me> Here are some more examples to clear it up a little:
Me> $ x=*      # x is set to a list of non-dotfiles in the current directory.
Me> $ x='*'    # x is set to just *
Me> $ x="*"    # x is still set to just *

In <446 at mccc.UUCP> pjh at mccc.UUCP (Pete Holsberg) writes:
PH> Dave has hit it on the nose.  

Whonk.  Dave should be hit _in_ the nose.  I'm surprised I let that
come out.  The first example is bogus.  Globbing is not done on the
RHS of variable assignment.  That is, it isn't done on the value to be
assigned.  If it had been

$ x= *

Then, assuming you had at least one file in the directory, an attempt
would be made to execute the first one to which * expanded with the
rest as arguments.  Fun, ne?

Sorry about the error,
Dave
--
 (setq mail '("tale at pawl.rpi.edu" "tale at itsgw.rpi.edu" "tale at rpitsmts.bitnet"))



More information about the Comp.unix.questions mailing list