zsh-workers
 help / color / mirror / code / Atom feed
* [Bug] Builtin "which" prints errors to stdout instead of stderr
@ 2017-08-22  8:58 Laurent, Jean-Baptiste
  2017-08-22  9:49 ` Oliver Kiddle
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent, Jean-Baptiste @ 2017-08-22  8:58 UTC (permalink / raw)
  To: zsh-workers

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

Hi,

Zsh 5.3.1 error message < XXX not found > is printed to stdout instead of stderr.
Zsh 5.3.1 - 0 #> which ccache
ccache not found
Zsh 5.3.1 - 1 #> which ccache 2> /dev/null
Zsh 5.3.1 - 2 #> which which

This has been also tested with a fresh install of zsh (5.0.8)
Zsh 5.0.8 - 0 #> which ccache
/usr/bin/which: no ccache in (...)
Zsh 5.0.8 - 1 #> unalias which
Zsh 5.0.8 - 2 #> which which
which: shell built-in command
Zsh 5.0.8 - 3 #> which ccache
ccache not found
Zsh 5.0.8 - 4 #> which ccache 2> /dev/null
Zsh 5.0.8 - 5 #> which which


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

* Re: [Bug] Builtin "which" prints errors to stdout instead of stderr
  2017-08-22  8:58 [Bug] Builtin "which" prints errors to stdout instead of stderr Laurent, Jean-Baptiste
@ 2017-08-22  9:49 ` Oliver Kiddle
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Kiddle @ 2017-08-22  9:49 UTC (permalink / raw)
  To: Laurent, Jean-Baptiste; +Cc: zsh-workers

"Laurent, Jean-Baptiste" wrote:
>
> Zsh 5.3.1 error message < XXX not found > is printed to stdout instead of stderr.
> Zsh 5.3.1 - 0 #> which ccache
> ccache not found
> Zsh 5.3.1 - 1 #> which ccache 2> /dev/null
> Zsh 5.3.1 - 2 #> which which

I believe this is actually intentional for compatibility with csh. It is
arguably not an error but informational. This last came up in workers/38747.

The which external was traditionally a C-shell script. Still is on
Solaris. Recent Linux has it as a binary and does send it to stderr. On
FreeBSD, it is silent.

If this keeps coming up, perhaps it'd be easier just to change it.

Oliver


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

end of thread, other threads:[~2017-08-22 13:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-22  8:58 [Bug] Builtin "which" prints errors to stdout instead of stderr Laurent, Jean-Baptiste
2017-08-22  9:49 ` Oliver Kiddle

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).