zsh-users
 help / color / mirror / code / Atom feed
* possible bug in zsh glob
@ 2010-02-23 16:13 dipakgaigole
  2010-02-23 16:26 ` Mikael Magnusson
  2010-02-23 17:20 ` Andrey Borzenkov
  0 siblings, 2 replies; 7+ messages in thread
From: dipakgaigole @ 2010-02-23 16:13 UTC (permalink / raw)
  To: zsh-users, zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1240 bytes --]

Hello,

I am finding this difference in the behavior while pattern matching.
Under Bash, it properly throws error for non matching pattern and shows the details of the matched pattern.

*************** bash **************
bash-2.05b$ pwd
/tmp
bash-2.05b$ ls -l *.txt *.jp
ls: *.jp: No such file or directory
-rw-r--r-- 1 dipak man 2 Feb 23 07:40 a.txt
-rw-r--r-- 1 dipak man 2 Feb 23 07:40 b.txt
-rw-r--r-- 1 dipak man 2 Feb 23 07:40 c.txt
bash-2.05b$
**********************************


Whereas under zsh 4.3.4, if any non-matching pattern is found, it also skips/ignores the matched pattern output.
************ zsh 4.3.4 ************
bash-2.05b$ ~/myzsh/bin/zsh-4.3.4 --version
zsh 4.3.4 (i686-pc-linux-gnu)
bash-2.05b$ ~/myzsh/bin/zsh-4.3.4
#pwd
/tmp
#ls -l *.txt *.jp
zsh: no matches found: *.jp
#set -o | grep -i glob
nobareglobqual off
nocaseglob off
cshnullglob off
extendedglob off
noglob off
noglobalexport off
noglobalrcs off
globassign off
globcomplete off
globdots off
globsubst off
kshglob off
nullglob off
numericglobsort off
shglob off
warncreateglobal off
#
**********************************

To me it looks like a bug. Does anyone has seen such behavior?

Thanks,
Dipak

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Re: possible bug in zsh glob
@ 2010-02-24 10:56 dipakgaigole
  2010-02-24 15:00 ` ( Text in unknown character set UTF-8 not shown ) Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: dipakgaigole @ 2010-02-24 10:56 UTC (permalink / raw)
  To: arvidjaar; +Cc: zsh-users, nyh, dipakgaigole

[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]

 

On Wed, 24 Feb 2010 13:36:09 +0530  wrote
>On Wednesday 24 of February 2010 10:53:52 Nadav Har'El wrote:
>> 
>> Is there any logical reason why zsh's default is the way it is? I.e.,
>> when it sees
>> 
>> ls -l *.txt *.jp
>> 
>> And there are no *.jp, it has to stop the entire command, rather than
>> let the command give you a message, like was always the case in the
>> Bourne shell, ksh, and bash (without the failglob option)?
>> 
>
>I guess, because it (zsh) originates more from csh.
>
>Anyway, it is too late to change defaults now.
>
>Personally I like to take it as indication that I made a typo in 
>command. I do not have any problems with extra quoting when needed :)
>

Before posting the question, I had a look at the glob options as well as the NOMATCH option, but the description of NOMATCH option was confusing.

This is the information from the zshoptions man page:
    NOMATCH (-3)



If a pattern for filename generation has no matches, print an error, instead 
of leaving it unchanged in the argument list.  This also applies to file 
expansion of an initial ~ or =.


Thanks for this info Andrey !!!

-Dipak

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-02-24 16:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-23 16:13 possible bug in zsh glob dipakgaigole
2010-02-23 16:26 ` Mikael Magnusson
2010-02-23 17:20 ` Andrey Borzenkov
2010-02-24  7:53   ` Nadav Har'El
2010-02-24  8:10     ` Andrey Borzenkov
2010-02-24 15:38     ` Matt Wozniski
2010-02-24 10:56 dipakgaigole
2010-02-24 15:00 ` ( Text in unknown character set UTF-8 not shown ) Bart Schaefer
2010-02-24 16:17   ` possible bug in zsh glob Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).