[–] alganet 1y ago ↗ > There is a new form of command substitution that executes the command in> the current shell execution context. Two forms are implemented: one that> reads the command substitution's output and another that expects to find> the result in the REPLY shell variable when the command substitution> completes.> New form of command substitution: ${ command; } or ${|command;} to capture> the output of COMMAND without forking a child process and using pipesThis is awesome. I haven't tested it yet, but if it is what I imagine, it means lots of speed for function/builtin calls.The REPLY variable comes historically from the `read` command default variable name, so it's familiar for experienced shell users.
1 comment
[ 2.6 ms ] story [ 5.3 ms ] thread> the current shell execution context. Two forms are implemented: one that
> reads the command substitution's output and another that expects to find
> the result in the REPLY shell variable when the command substitution
> completes.
> New form of command substitution: ${ command; } or ${|command;} to capture
> the output of COMMAND without forking a child process and using pipes
This is awesome. I haven't tested it yet, but if it is what I imagine, it means lots of speed for function/builtin calls.
The REPLY variable comes historically from the `read` command default variable name, so it's familiar for experienced shell users.