On Tue, Jan 17, 2017 at 01:56:29PM +0100, Hartmut Goebel wrote:
> Am 17.01.2017 um 12:34 schrieb Danny Milosavljevic:
> > For minimal improvement (I don't even think it's measureable), try
> > `git rev-list HEAD` (backquotes) - it prevents having to spawn a
> > subshell.
> 
> Huh? I doubt this. The bash manual, section "Command Substitution" does
> not distinguish between these both, as far as I understand it.

The POSIX shell command language specification says that:

"The shell shall expand the command substitution by executing command in
a subshell environment (see Shell Execution Environment) and replacing
the command substitution (the text of command plus the enclosing "$()"
or backquotes) with the standard output of the command, removing
sequences of one or more <newline>s at the end of the substitution."

http://pubs.opengroup.org/onlinepubs/007904875/utilities/xcu_chap02.html#tag_02_06_03

Maybe it's faster, maybe not, but I think my benchmark was
misinterpreted...

Reply via email to