Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [patch] "which"-builtin writes diagnostics to stdout
- X-seq: zsh-workers 36368
- From: Timo Buhrmester <fstd.lkml@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: [patch] "which"-builtin writes diagnostics to stdout
- Date: Tue, 1 Sep 2015 15:14:22 +0200
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=9wgBRgWBSh4H8JeaxTENnAkAEp8I0X4gjUD+sBNcYyo=; b=IueODTqtPMh8Nhiuy3h6segLGHeecj3VxHF8BXc+nqYO1jwr0xBhKtXjtqpcMmI8V3 vONmF33qimug/vyR8mTmrta7+V9nnat0sWVfDkq8JWAUYAmhGjRc9LWs2fWFUQ37BE5p +ryuT00a00hnxaFF70BM8PxoO1gM/yllbE8bCQiVnUB+h2Fu7nx4ykV1YJsN1allGL/n h5nWSV+n1zf+S0n3v44pPTw3lMIbKWP6ATSsDhbaIbpGvyXJpc/ORhILkfoIJVO8Clb2 ksYwvMmge9X6rEkU6HAqz3VWqLrUXTiQk6PerDUZ1MdS6SppEqJI8Vc7hc1wv+cggp8K zgSQ==
- In-reply-to: <150831230431.ZM894@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20150830030614.GB18893@frozen.localdomain> <CAH+w=7aNzRtsJcvGcfyYFPAiRtNY69imSN+oGrF7K7unD5aNcA@mail.gmail.com> <20150830052603.GE18893@frozen.localdomain> <150831230431.ZM894@torch.brasslantern.com>
> } Out of curiosity, what reason would zsh (being more bourne-ish than
> } csh-ish, as far as I can tell) have to maintain this particular csh
> } glitch rather than fixing it?
>
> What makes you think it's a glitch?
>
> I.e., "not found" here is not an error message! It is the answer to the
> question you asked
It seems to me like a diagnostic message intended for human consumption, mainly because there's an infinite number of ways it could answer the same thing (``I can' find <xyz>'' and ``no such <xyz>'', etc). So unless on the other end of the pipeline you have a human, or a program that understands English, you'll have to deal with this as a special case. Heck, I could even have a file named ``foobar not found'' sitting around, making things worse. :)
I obviously can't argue with behavior of ancient shells, but IMO there is exactly one correct, unambiguous and machine-readable answer to the ``which'' question:
The empty answer.
> and you asked for the answer in csh format ("which" is "whence -c").
> If you don't want csh behavior, you should be using "whence" directly
> so that you can omit the "-c" option.
Okay, I didn't know about that.
Doesn't make my point less valid, but I'm glad there's a way out with `whence`. Thanks.
Timo
Messages sorted by:
Reverse Date,
Date,
Thread,
Author