zsh-workers
 help / color / mirror / code / Atom feed
* multios and unnecessary processes
@ 2005-01-09 16:47 Stephane Chazelas
  2005-01-09 20:32 ` Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: Stephane Chazelas @ 2005-01-09 16:47 UTC (permalink / raw)
  To: Zsh hackers list

Hi, I would expect:

zsh -c 'lsof -ag $$ -d0-2,10-15 >&2 >&- >&2'

and 

zsh -c 'lsof -ag $$ -d0-2,10-15 >&2'

To work the same. However, in the first case, I get:

~$ zsh -c 'lsof -ag $$ -d0-2,10-15 >&2 >&- >&2'
~$ COMMAND  PID PGID     USER   FD   TYPE DEVICE SIZE  NODE NAME                                                                          16:39
lsof    7684 7684 chazelas    0u   CHR  136,6          8 /dev/pts/6
lsof    7684 7684 chazelas    1w  FIFO    0,7      21985 pipe
lsof    7684 7684 chazelas    2u   CHR  136,6          8 /dev/pts/6
zsh     7685 7684 chazelas   13u   CHR  136,6          8 /dev/pts/6
zsh     7685 7684 chazelas   14r  FIFO    0,7      21985 pipe

(note that my prompt is displayed before the result of lsof
because the output is written by that background zsh process).

In the second case, I get the expected behavior:

~$ zsh -c 'lsof -ag $$ -d0-2,10-15 >&2'
COMMAND  PID PGID     USER   FD   TYPE DEVICE SIZE NODE NAME
lsof    7702 7702 chazelas    0u   CHR  136,6         8 /dev/pts/6
lsof    7702 7702 chazelas    1u   CHR  136,6         8 /dev/pts/6
lsof    7702 7702 chazelas    2u   CHR  136,6         8 /dev/pts/6


I came accross this while trying to make some code independant
of the multios setting (hence the >&- to cancel the teed
redirection).

~$ zsh -f
% zmodload zsh/parameter
% echo $options[multios]
on

I'm not too sure it's a good idea to make multios the default.

-- 
Stéphane


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

end of thread, other threads:[~2005-01-11  9:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-09 16:47 multios and unnecessary processes Stephane Chazelas
2005-01-09 20:32 ` Bart Schaefer
2005-01-10  9:49   ` Stephane Chazelas
2005-01-10 16:53     ` Bart Schaefer
2005-01-10 17:11       ` Stephane Chazelas
2005-01-10 19:20         ` Bart Schaefer
2005-01-10 19:48           ` Peter Stephenson
2005-01-11  9:07           ` Stephane Chazelas

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