stdout2env - Substitute other command's STDOUT in command arguments and run the resulting command



NAME

stdout2env - Substitute other command's STDOUT in command arguments and run the resulting command


SYNOPSIS

stdout2env [OPTIONS] -- ENVNAME-1 CMD-1 [ARG [ARG [...]]] [-- ENVNAME-2 CMD-2 [ARG [ARG [...]]] [-- ...]] [--] COMMAND [ARGS]


DESCRIPTION

Run all CMD-1, CMD-2, ... commands in series, and after each run, set the ENVNAME-n environment variable to the corresponding command's STDOUT output. Then at the end, run the last COMMAND with all the environment set up. Very similar to backtick notation `CMD` (and $(CMD)) in ordinary shells.

Earlier set ENVNAME variables are visible in later commands with their new value.


OPTIONS

-d, --delimiter STRING

Take STRING as the command argv-list delimiter. Default is double-dash --.

--keep-eol

Keep the newline char at the very end of each output.


CAVEATS

Overwriting PATH environment may render the subsequent commands not being found.


RATIONALE

Sometimes you don't want a shell to be in the picture when composing commands.


SEE ALSO

backtick by execlineb(1), multicmd(1), substenv(1)

 stdout2env - Substitute other command's STDOUT in command arguments and run the resulting command