Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: CSH_NULL_GLOB broken?



On Mon, Jun 09, 1997 at 02:49:10PM -0600, Steve Talley wrote:
> CSH_NULL_GLOB doesn't appear to work in 3.1.0:
> 
> % unsetopt nomatch
> % unsetopt nullglob
> % setopt cshnullglob
> % ls -d /tmp
> /tmp/
> % ls -d /blah*
> zsh: no match 
> % ls -d /tmp /blah*
> zsh: no match
> 
> The last command, according to the zshoptions man page, should have
> listed /tmp and ignored the fact that nothing matches /blah*.  Am I
> missing something?

Yes: /tmp isn't a pattern. Try for instance: ls -d /tm[p] /blah*
It won't complain.

Note that:

1) tcsh will also complain if you write: ls -d /tmp /blah*

2) If you wanted to regard /tmp as a pattern, it would be difficult to
decide what is a pattern and what isn't. If /tmp were a pattern, -d
should also be a pattern, as zsh cannot guess which arguments will be
regarded as filenames (it depends on the command).


Now, there's something I don't like:

$ ls -d /tmp() /blah
$ ls
zsh: no such file or directory: /blah
$ whence -ac ls
ls: aliased to \ls -bF --color=tty
ls () {
        /blah
}
/home/vlefevre/bin-sparc/ls
...

(-bF, --color=tty, -d and /tmp functions are created too.)

-- 
Vincent Lefevre, vlefevre@xxxxxxxxxxx | Acorn Risc PC, StrongARM @ 202MHz
http://www.ens-lyon.fr/~vlefevre      | 20+1MB RAM, Eagle M2, TV + Teletext
PhD in Computer Science, 1st year     | Apple CD-300, SyQuest 270MB (SCSI)
-----------------------------------------------------------------------------



Messages sorted by: Reverse Date, Date, Thread, Author