Skip to content

Instantly share code, notes, and snippets.

@omar-yassin
Created October 6, 2016 17:16
Show Gist options
  • Save omar-yassin/dd997f4e59ea59634182b9b446a63a7e to your computer and use it in GitHub Desktop.
Save omar-yassin/dd997f4e59ea59634182b9b446a63a7e to your computer and use it in GitHub Desktop.
BASH: loop through variable string, line by line
some_string_with_newlines="..."
while read -r line ; do
echo " xxx $line"
done <<< "$some_string_with_newlines"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment