Skip to content

Instantly share code, notes, and snippets.

@fcamel
Created June 8, 2011 17:32
Show Gist options
  • Save fcamel/1014883 to your computer and use it in GitHub Desktop.
Save fcamel/1014883 to your computer and use it in GitHub Desktop.
prepare "a list of strings" in shell script
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