Quick hack to rename BeyondTV files

The format of BeyondTV doesn’t look as good on Front Row as I’d like. This cleans the file name up. This is an ugly script without any error checking, or verification, or any of the things it should have. But it was quick, easy, and it works. For me. Today. No warranty is assumed or implied.

for X in *\(*
do
DEST=`echo $X | awk -F- '{print $1}'`
FILENAME=`echo $X | awk -F\( '{print $2}' | awk -F\) '{print $1}' | awk '{sub(/_/," -");print}'`
mv "$X" "/Network/Servers/10.0.0.4/media/Videos/${DEST}/${FILENAME}.mp4"
done

and for my .bashrc

mover()
{
for X in *\(*; do DEST=`echo $X | awk -F- '{print $1}'`;FILENAME=`echo $X | awk -F\( '{print $2}' | awk -F\) '{print $1}' | awk '{sub(/_/," -");print}'`;mv "$X" "/Network/Servers/10.0.0.4/media/Videos/${DEST}/${FILENAME}.mp4"; done
}

This is an older version of the script, but I’m keeping it for reference.

for X in *\(*
do
Y=`echo $X | awk -F\( '{print $2}' | awk -F\) '{print $1}' | awk '{sub(/_/," -");print}'`
mv "$X" "$Y.mp4"
done

I’ve also added it as a function to my .bashrc file

rename()
{
for X in *\(*; do Y=`echo $X | awk -F\( '{print $2}' | awk -F\) '{print $1}' | awk '{sub(/_/," -");print}'`; mv "$X" "$Y.mp4"; done
}

These are both works in process