The problem that I have is that the scripts I originally made in Mac OS X with bash don't work on XP. I would somehow like to convert my TV script from bash to cmd/batch? (new to windows scripting), and at the same time, begin to get an understanding of a windows language, so I can continue customising.
My TV script is simple, but has been effective on my mac, and is shown below in bash:
Code: Select all
#!/bin/sh
FOLDER_PATH="$1"
cd "$FOLDER_PATH"
FOLDER_NAME=`echo $FOLDER_PATH | awk -F [/] '{print $NF}'`
echo "\n\nChecking for .avi file..."
if [ -e *.avi ]
then
echo "\n\n$FOLDER_NAME.avi found and copied into relevant TV folder."
cp *.avi "../$FOLDER_NAME.avi"
rm -rf "$FOLDER_PATH"
else
echo "\n\n\tNo .avi file found, left in SABnzbd+ directory."
fi
echo "\n\n...Processing Complete!"
Cheers.