Bad Interpreter

Hi. My name is Caleb (a.k.a RagingNinja) form the whited00r forums. (Whited00r makes custom firmware for iOS devices).

I have been learning and creating simple shells scripts. I have been recently using VIM for Windows or using VirtualBox to run the UBUNTU OS within VirtualBox to create my shell scripts. But I keep getting this "Bad interpreter; no such file or directory" error.

Here is the script.

#!/bin/sh
# A script made by RagingNinja to apply a Lock Info Theme.

#-------------------------------------


clear
echo "Lock Info iOS 5 theme v1.3.1 BETA"
sleep 2
echo
echo #####################################
sleep 2

echo "This script will place the iOS 5 theme 
images in the right places"
sleep 3

echo "--------------------------------------------"

echo

sleep 6

base=/Library/iOS5LockInfo
lockinfo_base=/Library/LockInfo

mv "/Library/iOS5LockInfo/iOS5LockScreen" "$lockinfo_base/Themes";

if [[ -d "$lockinfo_base/Themes/iOS5LockScreen" ]]; then
echo "iOS 5 LockInfo Lock Screen Images Moved";
else echo "Error...."
fi

sleep 2


echo
echo

sleep 2

mv "/Library/iOS5LockInfo/iOS5InfoShade" "$lockinfo_base/Themes";

if [[ -d "$lockinfo_base/Themes/iOS5InfoShade" ]]; then
echo "iOS 5 LockInfo InfoShade Images Moved"
sleep 1

echo

echo "Please press Enter/Return to Continue";
else echo "Error...";
    
    echo "Please press Enter/Return to Continue";

sleep 2


echo
echo

sleep 4

if [[ -d "$base" ]]; then
    echo "Sucessful and ready to go!";
    sleep 2
    echo
    echo
else echo "iOS 5 Theme File doens't exist, please contact RagingNinja for support"
exit;
clear
fi

echo
echo

echo "Themes moved and ready to be applied manually via LockInfo Settings";
sleep 2


echo
echo

# Now to move the icons in the right places

fi

while read names; do

echo "Now moving icons to the right places...";
sleep 4

cp "$base/LockInfoIcons/Bundles/com.ashman.LockInfo/LIInfoShadeBG.png" "$lockinfo_base";

cp "$base/LockInfoIcons/Bundles/com.ashman.LockInfo/LIInfoShadeBG@2x.png" "$lockinfo_base";

echo
echo

cp "$base/LockInfoIcons/Bundles/com.ashman.lockinfo.CalendarPlugin/Silver_LISectionIcon.png" "$lockinfo_base/Plugins/com.ashman.lockinfo.CalendarPlugin.bundle";

cp "$base/LockInfoIcons/Bundles/com.ashman.lockinfo.CalendarPlugin/Silver_LISectionIcon@2x.png" "$lockinfo_base/Plugins/com.ashman.lockinfo.CalendarPlugin.bundle";



echo
echo

cp "$base/LockInfoIcons/Bundles/com.ashman.lockinfo.FavoritesPlugin/Silver_LISectionIcon.png" "$lockinfo_base/Plugins/com.ashman.lockinfo.FavoritesPlugin.bundle";

cp "$base/LockInfoIcons/Bundles/com.ashman.lockinfo.FavoritesPlugin/Silver_LISectionIcon@2x.png" "$lockinfo_base/Plugins/com.ashman.lockinfo.FavoritesPlugin.bundle";

cp "$base/LockInfoIcons/Bundles/com.ashman.lockinfo.MailPlugin/Silver_LISectionIcon.png" "$lockinfo_base/Plugins/com.ashman.lockinfo.MailPlugin.bundle";

cp "$base/LockInfoIcons/Bundles/com.ashman.lockinfo.MailPlugin/Silver_LISectionIcon@2x.png" "$lockinfo_base/Plugins/com.ashman.lockinfo.MailPlugin.bundle";

cp "$base/LockInfoIcons/Bundles/com.ashman.lockinfo.PushNotificationPlugin/Silver_LISectionIcon.png" "$lockinfo_base/Plugins/com.ashman.lockinfo.PushNotificationPlugin.bundle";

cp "$base/LockInfoIcons/Bundles/com.ashman.lockinfo.PushNotificationPlugin/Silver_LISectionIcon@2x.png" "$lockinfo_base/Plugins/com.ashman.lockinfo.PushNotificationPlugin.bundle";

cp "$base/LockInfoIcons/Bundles/com.ashman.lockinfo.PhonePlugin/Silver_LICall.png" "$lockinfo_base/Plugins/com.ashman.lockinfo.PhonePlugin.bundle";

cp "$base/LockInfoIcons/Bundles/com.ashman.lockinfo.PhonePlugin/Silver_LICall@2x.png" "$lockinfo_base/Plugins/com.ashman.lockinfo.PhonePlugin.bundle";

echo
echo


echo "Almost Done..."

cp "$base/LockInfoIcons/Bundles/com.ashman.lockinfo.PhonePlugin/Silver_LIVMail.png" "$lockinfo_base/Plugins/com.ashman.lockinfo.PhonePlugin.bundle";

cp "$base/LockInfoIcons/Bundles/com.ashman.lockinfo.PhonePlugin/Silver_LIVMail@2x.png" "$lockinfo_base/Plugins/com.ashman.lockinfo.PhonePlugin.bundle";

cp "$base/LockInfoIcons/Bundles/com.ashman.lockinfo.SMSPlugin/Silver_LISectionIcon.png" "$lockinfo_base/Plugins/com.ashman.lockinfo.SMSPlugin.bundle";

cp "$base/LockInfoIcons/Bundles/com.ashman.lockinfo.SMSPlugin/Silver_LISectionIcon@2x.png" "$lockinfo_base/Plugins/com.ashman.lockinfo.SMSPlugin.bundle";

sleep 5


echo

echo
echo "All Finished! Hope you enjoyed!";

echo
echo
sleep 3

echo "Please Consider Donating!";

sleep 3
echo 
echo

echo "By...RagingNinja & Whited00r";
sleep 5
echo
echo
sleep 1

echo "Thanks!!!!";
sleep 2

echo
echo


sleep 1

echo 'Would you like to Respring now? Mandatory to take effect! [y/n]';
read ans

if [ "$ans" = "y" ]; then
    echo "Respringing...";
    killall SpringBoard
else echo "No effect will take place until a respring/reboot";
    exit

fi

done

The instructions are to put the "iOS5LockInfo" file into "/Library"

Then put the iOS5LockInfo.sh in "/var/mobile" and give "0755" permissions by doing it manually or using the "chmod +x iOS5LockInfo.sh" command.

The script runs perfectly fine on my iPhone 2G (WD v4.4.1 - iOS 3.1.3). Please help...

P.S The Bad interpreter error is coming from other people. Not me.

AND yes I know there are some lines of code in there that aren't doing anything or are useless. Its still in BETA testing and I'm just trying to get around the bad interpreter stuff.

FYI I'm a ULTRA beginner scripter. :wink:

For the message "no such file or directory", as you have several files/directories,
I would issue an "ls -ld name" for each file or directory you have in the script
just before you use it the first time (with 'cp' or 'mv').

One of them does not exist.

You get 'bad interpreter' because Windows fills its text files with useless carriage returns. You end up with '#!/bin/bash^M' as your first line and since there's no file named /bin/bash^M you get "bad interpreter".

You can fix existing files with tr -d '\r' < infile > outfile but it's best to edit your Ubuntu scripts in Ubuntu.