Skip to content

Instantly share code, notes, and snippets.

@coderjoe
Created December 9, 2011 02:20
Show Gist options
  • Save coderjoe/1449820 to your computer and use it in GitHub Desktop.
Save coderjoe/1449820 to your computer and use it in GitHub Desktop.
Parse a list of files
#is it coming from another file?
#is it newline separated?
#if not you can use IFS to change the separation character
for i in `ls`
do
echo "$i"
done
#What if there are spaces?
#updated after MarshalBanana asked
ls | read i
do
echo "$i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment