Created
June 8, 2011 17:32
-
-
Save fcamel/1014883 to your computer and use it in GitHub Desktop.
prepare "a list of strings" in shell script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files=$(cat <<EOF | |
1st line | |
2nd line | |
3rd line | |
EOF | |
) | |
IFS=$'\n' | |
for f in $files | |
do | |
echo "*********************" | |
echo $f | |
done | |
unset IFS | |
# ---- output ---- | |
# ********************* | |
# 1st line | |
# ********************* | |
# 2nd line | |
# ********************* | |
# 3rd line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment