Skip to content

Instantly share code, notes, and snippets.

@bradwright
Created January 25, 2009 13:33
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 bradwright/51788 to your computer and use it in GitHub Desktop.
Save bradwright/51788 to your computer and use it in GitHub Desktop.
# Useful snippet if you have a list of files with spaces in their names
# (I'm looking at you, OS X)
# path separators so I can use spaces in filenames
OLD_IFS=${IFS}
# just use a linebreak and remove the space character
IFS="
"
select opt in $list_of_files_with_spaces ; do
echo $opt
# repair IFS
IFS=${OLD_IFS}
exit 0
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment