Skip to content

Instantly share code, notes, and snippets.

@smoak
Created December 14, 2011 18:55
Show Gist options
  • Save smoak/1477944 to your computer and use it in GitHub Desktop.
Save smoak/1477944 to your computer and use it in GitHub Desktop.
$ ls Foo\ -\ S1\ -\ *
Foo - S1 - 02 Foo - S1 - 06 Foo - S1 - 10
Foo - S1 - 03 Foo - S1 - 07 Foo - S1 - 11
Foo - S1 - 04 Foo - S1 - 08
Foo - S1 - 05 Foo - S1 - 09
$ for f in Foo\ -\ S1\ -\ *
do
newFile=`echo $f | sed 's/Foo - S1 - /Foo_S01_/g'`
cp $f $newFile
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment