Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srathbun/5548046 to your computer and use it in GitHub Desktop.
Save srathbun/5548046 to your computer and use it in GitHub Desktop.
how to split a single line with read in a posix manner ( no arrays )
#!/bin/dash
echo "a,b,c" | while read line; do
IFS=','
set -- $line
for word in "$@"; do echo "$word"; done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment