Store stdout in Bash Variable

Last modified: 
Thursday, April 2nd, 2015

Storing a string

echo $CWD

Storing a directory file listing

echo $FILES
for f in $FILES; do
    echo $f

Outputs something like:


The operator of this site makes no claims, promises, or guarantees of the accuracy, completeness, originality, uniqueness, or even general adequacy of the contents herein and expressly disclaims liability for errors and omissions in the contents of this website.