From: Aaron Davies <agdavi01@louisville.edu>
To: zsh-users@sunsite.dk
Subject: Re: Suppressing "no matches found" Glob Message?
Date: Tue, 29 Jun 2004 19:04:00 -0400 [thread overview]
Message-ID: <9B465416-CA20-11D8-951F-000A95EDC31A@louisville.edu> (raw)
In-Reply-To: <Pine.LNX.4.60.0406280814510.19831@toltec.zanshin.com>
On Jun 29, 2004, at 12:12 PM, Bart Schaefer wrote:
> On Mon, 28 Jun 2004, DervishD wrote:
>
>> 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.
>
> You're on the right track in a later posting on this thread where you
> used
> a function rather than an alias. Aliases can't do anything but simple
> text replacements which happen before any of the glob patterns or other
> expansions are evaluated. If you want to base a decision on the
> result of
> an expansion, you must use a function.
>
> In this case, something like
>
> lspf() {
> files=( **/*(.N) )
> if (( $#files ))
> then
> ls $files
> else
> print -u2 "Dude, where's my file?"
> fi
> }
This works great on one of the boxes I use zsh on (a OS X Panther) box,
but not on the other (a Jaguar box). On the 10.2 one, I get
zsh: lspf: function definition file not found
when I try to run the function, despite having
fpath=(~/Documents/functions $fpath)
autoload lspf
in .zshrc and the above definition for lspf in
~/Documents/functions/lspf.sh . What's wrong?
> Of course, when I try that, I get "argument list too long: ls" but
> that's
> a different issue.
--
Aaron Davies
agdavi01@louisville.edu
next prev parent reply other threads:[~2004-06-29 23:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-27 2:39 Aaron Davies
2004-06-27 10:42 ` DervishD
2004-06-27 22:50 ` Aaron Davies
2004-06-28 8:53 ` DervishD
2004-06-28 22:53 ` Aaron Davies
2004-06-29 8:52 ` DervishD
2004-06-29 9:56 ` Lloyd Zusman
2004-06-29 10:41 ` DervishD
2004-06-29 16:12 ` Bart Schaefer
2004-06-29 16:34 ` DervishD
2004-06-29 23:04 ` Aaron Davies [this message]
2004-06-30 10:10 ` Bart Schaefer
2004-07-01 4:28 ` Aaron Davies
2004-06-27 22:52 ` Aaron Davies
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9B465416-CA20-11D8-951F-000A95EDC31A@louisville.edu \
--to=agdavi01@louisville.edu \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).