Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Suppressing "no matches found" Glob Message?
- X-seq: zsh-users 7619
- From: DervishD <raul@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Suppressing "no matches found" Glob Message?
- Date: Tue, 29 Jun 2004 18:34:10 +0200
- In-reply-to: <Pine.LNX.4.60.0406280814510.19831@xxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Pleyades
- References: <2A3E94EA-C7E3-11D8-9C37-000502631FBD@xxxxxxxxxxxx> <20040627104222.GA237@DervishD> <6D3CE77E-C88C-11D8-A1EE-000A95EDC31A@xxxxxxxxxxxxxx> <20040628085300.GA1443@DervishD> <Pine.LNX.4.60.0406280814510.19831@xxxxxxxxxxxxxxxxxx>
Hi Bart :)
* Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> dixit:
> > In certain sense, what you want is impossible. If you issue the 'ls'
> > command with parameters, it will list those parameters (if they exist),
> > but if you don't give it params, it will list all files and dirs. You
> > cannot have a way of 'ls' shutting its mouth up if the pattern doesn't
> > match anything.
> Well, no, but you can have zsh not call "ls" in the first place if the
> pattern doesn't match anything.
Of course, but I think is faster to use 'find' or even 'print'
together with the stat module, instead of 'ls' and a monster command
line. That expansion **/*, can lead to a huge command line as you
point at the end of your message.
> lspf() {
> files=( **/*(.N) )
> if (( $#files ))
> then
> ls $files
> else
> print -u2 "Dude, where's my file?"
> fi
> }
Nice :))))
> Of course, when I try that, I get "argument list too long: ls" but that's
> a different issue.
You can use xargs, of course, but then you can use 'find' in the
first place.
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author