Skip to content

Instantly share code, notes, and snippets.

@DamnedFacts
Created March 18, 2013 12:13
Show Gist options
  • Save DamnedFacts/5186759 to your computer and use it in GitHub Desktop.
Save DamnedFacts/5186759 to your computer and use it in GitHub Desktop.
BASH: For Loop File Names With Spaces
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for f in *
do
echo "$f"
done
IFS=$SAVEIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment