Return to Snippet

Revision: 55144
at January 28, 2012 17:42 by licensetoil

Initial Code
alias rm_whitespace="for F in * ; do NF=\`echo \$F | perl -lne \"s/ /-/g; s/\_/-/g; s/[,']//g; s/[-]+/-/g; print\"\` ; mv \"\$F\" \"\$NF\" ; done"

Initial URL

Initial Description
Add this to your .profile or .bash_rc file, source the file, navigate to the directory and call "rm_whitespace"

Based on:

Initial Title
Batch remove whitespace in all the files in directory and replace with a dash "-"

Initial Tags
unix, files, perl

Initial Language