juliushibert63
October 22nd, 2010, 01:05 PM
I've chopped together a bash script that I've been using for the last 6 months on my mac. It basically parses through a directory supplied via the Terminal and then search each sub directory running a script called tvrenamer.pl. This renames all the TV episodes in each directory based on the info on TVdb.
I've just setup an Ubunutu 10.4 64bit system and tried to use the script but get an error;
gil@gil-htpc:~/Scripts$ sudo ./clean_tv_names.sh ~/Videos/TV/
[sudo] password for gil:
\n
The directory we're going to try and rename TV files in is /home/gil/Videos/TV/
Is this correct Y/N?
Y
find: unknown predicate `-E'
\n
Finished renaming all the files and closing up shop
gil@gil-htpc:~/Scripts$
I would of though as both Mac OS X and Ubuntu both use the same Terminal it would all run the same. But evidently not. Any ideas what's causing the error?
Here's the contents of the bash script that's running. As I said works absolutely fine on my OS X 10.6 system.
#!/bin/sh
######################################
#
#
# Script source: http://www.robmeerman.co.uk/coding/file_renamer
# Author: Adrian
#> I have a script that I run regularly to scan through the TV Shows
#> directory on my NAS. The script runs tvrenamer.pl on any likely
#> looking directory (assuming a directory structure such as
#> "Programme/Series x" or "Programme/Season x" where x is a numeric
#> value). The script is very rough and ready and looks like this:
#
#
# Commented and mods by: Gil Cocker
#
#Date:21/02/2010
#######################################
# Setup the dir/vars that the script will work on
TV_DIR=$1
#This is directory we want the script to run on
TVRENAMER_SCRIPT=~/Scripts/tvrenamer.pl
#Where the tvreanmer.pl script is
echo "\n"
echo "The directory we're going to try and rename TV files in is $TV_DIR"
echo "Is this correct Y/N?"
read choice
if [ $choice = "Y" ]; then
cd "$TV_DIR"
IFS=$'\n'
for dir in `find -E . -type d -iregex "./[^/]*/S(eason|eries)[[:space:]]+[0-9]+"`; do
( cd "$dir"; rm -f ._*; "$TVRENAMER_SCRIPT" --reversible --scheme=SXXEYY --pad=2 $
done
echo "\n"
echo "Finished renaming all the files and closing up shop"
else
echo "\n"
echo "Quiting....."
fi
I've just setup an Ubunutu 10.4 64bit system and tried to use the script but get an error;
gil@gil-htpc:~/Scripts$ sudo ./clean_tv_names.sh ~/Videos/TV/
[sudo] password for gil:
\n
The directory we're going to try and rename TV files in is /home/gil/Videos/TV/
Is this correct Y/N?
Y
find: unknown predicate `-E'
\n
Finished renaming all the files and closing up shop
gil@gil-htpc:~/Scripts$
I would of though as both Mac OS X and Ubuntu both use the same Terminal it would all run the same. But evidently not. Any ideas what's causing the error?
Here's the contents of the bash script that's running. As I said works absolutely fine on my OS X 10.6 system.
#!/bin/sh
######################################
#
#
# Script source: http://www.robmeerman.co.uk/coding/file_renamer
# Author: Adrian
#> I have a script that I run regularly to scan through the TV Shows
#> directory on my NAS. The script runs tvrenamer.pl on any likely
#> looking directory (assuming a directory structure such as
#> "Programme/Series x" or "Programme/Season x" where x is a numeric
#> value). The script is very rough and ready and looks like this:
#
#
# Commented and mods by: Gil Cocker
#
#Date:21/02/2010
#######################################
# Setup the dir/vars that the script will work on
TV_DIR=$1
#This is directory we want the script to run on
TVRENAMER_SCRIPT=~/Scripts/tvrenamer.pl
#Where the tvreanmer.pl script is
echo "\n"
echo "The directory we're going to try and rename TV files in is $TV_DIR"
echo "Is this correct Y/N?"
read choice
if [ $choice = "Y" ]; then
cd "$TV_DIR"
IFS=$'\n'
for dir in `find -E . -type d -iregex "./[^/]*/S(eason|eries)[[:space:]]+[0-9]+"`; do
( cd "$dir"; rm -f ._*; "$TVRENAMER_SCRIPT" --reversible --scheme=SXXEYY --pad=2 $
done
echo "\n"
echo "Finished renaming all the files and closing up shop"
else
echo "\n"
echo "Quiting....."
fi