Skip to content

Instantly share code, notes, and snippets.

@ivankelly
Created April 15, 2011 10:36
Show Gist options
  • Save ivankelly/921504 to your computer and use it in GitHub Desktop.
Save ivankelly/921504 to your computer and use it in GitHub Desktop.
Sed rename script
#!/bin/sh
part2() {
NEWDIR=`dirname "$1"`
cd "$NEWDIR"
FF=`echo "$1" | awk -F: '{print $2}'`
DIR=`find . -name $FF.dpx | head -1 | xargs dirname | sed s!^\./!!`
cd "$OLDPWD"
echo $DIR
}
part1 () { echo `dirname "$1" | awk -F\/ '{print $(NF)}'`; }
P1=`part1 "$1"`
P2=`part2 "$1"`
echo "$1" "${P1}_$P2.mov";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment