Strangeness in shell

Pete Holsberg pjh at mccc.UUCP
Sun Jul 30 12:35:23 AEST 1989


In article <TALE.89Jul27194738 at imagine.pawl.rpi.edu> tale at pawl.rpi.edu writes:
=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.  

	Consider it done!
	
=I'm surprised I let that
=come out.  The first example is bogus.  Globbing is not done on the
=RHS of variable assignment.  

	Why not?
	
=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.

	How about a logical explanation of why
		x=*
		x="*"  and
		x='*'
have the same effect??
-- 
Pete Holsberg -- Mercer College -- Trenton, NJ 08690
...!rutgers!princeton!njsmu!mccc!pjh



More information about the Comp.unix.questions mailing list