E.V.
0
Q:

save output of command to variable bash

OUTPUT="$(ls -1)"
echo "${OUTPUT}"

MULTILINE=$(ls \
   -1)
echo "${MULTILINE}"
3
variable=$(command [option…] argument1 arguments2 …)
5

New to Communities?

Join the community