Skip to content

Instantly share code, notes, and snippets.

@edgabaldi
Last active November 14, 2016 16:54
Show Gist options
  • Save edgabaldi/f584a0bab637d8263fea908326cb7664 to your computer and use it in GitHub Desktop.
Save edgabaldi/f584a0bab637d8263fea908326cb7664 to your computer and use it in GitHub Desktop.
BASH Shell: For Loop File Names With Spaces
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for f in $(ls | grep -v git | grep -v salvar_documentos.py | grep -v dt18)
do
mv $f dt18/
done
IFS=$SAVEIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment