Re: zsh globbing
%% Johann Spies <jhspies@adept.co.za> writes:
js> In bash I can do this:
js> js-21:57:41-~$dpkg -l zsh*
Traditional Bourne shell behavior specifies that if a globbing
expression matches no files, then the globbing expression itself is
passed to the program as an argument.
So, assuming you have no files in your current directory that match
zsh*, sh (and bash) pass the string 'zsh*' to the program (dpkg) and it
DTRT.
If you happen to have a file in your directory that _does_ match this,
then it will be passed to dpkg and most likely it will not work.
js> zsh % dpkg -l zsh*
js> zsh: no matches found: zsh*
Zsh, apparently, behaves differently when a globbing expression does not
match anything, and returns an error. If you check the zsh man page
I'll bet there's a configuration option you can specify.
To be really safe you should do this, regardless of shell:
dpkg -l zsh\*
or:
dpkg -l 'zsh*'
to quote the "*" character from the shell and pass it to the process
(dpkg).
js> While I can do
js> zsh % ls .z*
js> .zcompdump .zhistory .zshrc .zshrc~
I don't see what this has to do with anything; perhaps you're
misunderstanding how globbing works in UNIX--it's not anything like how
it works in DOS or Windows!
--
-------------------------------------------------------------------------------
Paul D. Smith <pausmith@nortelnetworks.com> HASMAT--HA Software Mthds & Tools
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
These are my opinions---Nortel Networks takes no responsibility for them.
Reply to: