Zsh Mailing List Archive
Messages sorted by:
Re: exec - interactive vs non-interactive shell
- X-seq: zsh-users 16080
- From: "Radoulov, Dimitre" <cichomitiko@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: exec - interactive vs non-interactive shell
- Date: Thu, 02 Jun 2011 11:37:11 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=+M61ldvc9z3Hpc2bmlxeP2gX2qcFf4nMc/dYy6ItYks=; b=QvK9k2Sm7p6kDNZ4Wirl9PXEyS/V/3n49Lr2D68CjgMKRYlB632d4boqJBGIrtTGnX xJ/VYZroi/D4Ro47sl2rrVF9CuIfsfhP6xPq+BD/j7W2GaJcp8fzUHIFhtg8zNc1W4Se 8CWT1M20nOjLhP6f6XUYPRmpTn9l6jsiqPXNc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=BbUyE/R4D4p3kGlSAfdjq8XE9DoGuMeK7FJ+47+ad85I9uCTnmwM3waCe1zoZ/h536 NbOg3dNJDGqiN1UVmLTuoPvLOpBRJfjyhcRIjhqmeUBiqU2X2MM4gXqys502sCfKbbo7 RSNISmEZphg7CviTvKWXKRLyKSA0qfGEVrgyQ=
- In-reply-to: <firstname.lastname@example.org>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <4DE69918.email@example.com> <firstname.lastname@example.org> <4DE6B72B.email@example.com> <firstname.lastname@example.org>
On 02/06/2011 10:59, Peter Stephenson wrote:
On Wed, 01 Jun 2011 23:03:23 +0100, Radoulov, Dimitre
On 01/06/2011 22:42, Peter Stephenson wrote:
ash, dash and bash, for example, behave differently (ksh and variants
seem to behave like zsh).
On Wed, 01 Jun 2011 21:55:04 +0200
"Radoulov, Dimitre"<cichomitiko@xxxxxxxxx> wrote:
zsh-4.3.11[t]% cat a_script
zsh-4.3.11[t]% zsh< a_script
So cat has taken over stdin, as expected.
Do you know if this behavior is defined by the POSIX standard?
I suppose this is down to the behaviour of exec. I didn't see anything
in the standard about what it should do with stdin when the current
shell was replaced with no additional redirection.
I think what's happened is probably that the shells that don't show
you anything have read ahead, so you still keep stdin from the same
place, but you don't necessarily get the very next line. I suspect
this behaviour isn't defined. (If that's right, then zsh's and ksh's
behaviour is the philosophically correct one, but there are
extenuating circumstances for the others.)
If the shell is interactive, there's no script name nor explicit
input redirection (<) ,
command and standard input come from the same channel too (the
or I'm missing something?
You're not fundamentally missing anything, no, I deliberately glossed
over the way the shell opens the terminal. It is based on stdin,
but in practice the shell duplicates the file descriptor and does
its terminal processing on a hidden one (i.e. greater than 9).
Messages sorted by: