Pipelining & redirection (Bash)
Versie door Jeroen Strompf (overleg | bijdragen) op 9 sep 2022 om 08:36
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.