Store stdout in Bash Variable
Posted:
Thursday, April 2nd, 2015Last modified:
Thursday, April 2nd, 2015Storing a string
CWD="$(pwd)" echo $CWD /home/hotpants
Storing a directory file listing
FILES=./* echo $FILES for f in $FILES; do echo $f done
Outputs something like:
./Applications ./Desktop ./Documents ./Downloads ./Library ./Movies ./Music ./Pictures ./Public
Available Wiki Topics
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.