Pipelining & redirection (Bash)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen

Redirect output to a variable

There are more aspects to this question than covered here, but this will usually work:

dir=$(ls)

xargs

xargs is a more explicit way of reusing the output of a command. I often use it, when more implicit ways of pipelining like through > or | doesn't work, like with WP-CLI. See xargs for details.

See also

Sources