Gentoo Archives: gentoo-dev

From: Dan Douglas <ormaaj@×××××.com>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] lastpipe
Date: Fri, 25 May 2012 20:03:54
Message-Id: 6389596.CXSmRX32zB@smorgbox
1 As many are probably aware, Bash 4.2 adds a shopt feature to enable not
2 running the last command of a pipeline in a subshell (POSIX leaves it up to
3 the shell to decide). Aside from being a slight optimization, it allows some
4 syntactic convenience such as reduced reliance upon process substitutions and
5 redundant command grouping workarounds. I believe it is generally considered
6 that the lastpipe behavior is superior. zsh and ksh do this by default, while
7 mksh, bash, and dash do not. Only Bash has it as a configurable option.
8
9 If it were made a policy now that ebuilds and eclasses cannot depend upon the
10 subshell (for example, to set temporary positional parameters or isolate
11 temporary variables), then maybe someday in the distant future this could be
12 made the default, and in the meantime, an option for those with new enough
13 shells. Since dependence on the subshell isn't very common, I think this
14 should be feasible, and of course as a workaround all that's required is to
15 wrap any such commands in parentheses.
16
17 Any opinions?
18 --
19 Dan Douglas

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] lastpipe Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>