Bad Interpreter


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Bad Interpreter
# 1  
Old 08-03-2011
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.

Code:
#!/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. Smilie
# 2  
Old 08-03-2011
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.
# 3  
Old 08-03-2011
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

-bash: ./p4: /bin/ksh^M: bad interpreter: No such file or directory

I keep getting this error and I am not sure why. -bash: ./p4: /bin/ksh^M: bad interpreter: No such file or directory First I run my makefile and this works fine: goodmain: main.o gcc -o goodmain main.o main.o: main.c gcc -c main.c Then I want to limit my output so I... (11 Replies)
Discussion started by: cokedude
11 Replies

2. UNIX for Advanced & Expert Users

Sqlite3: /lib/ld-Linux.so.2: bad ELF interpreter:

Hi all I'm hoping this is just me being a muppet, has anyone come across this problem before? I am writing an application that uses sqlite3 and I have created a database using it - sqlite3 muse.db SQLite version 3.6.20 Enter ".help" for instructions Enter SQL statements terminated with... (2 Replies)
Discussion started by: steadyonabix
2 Replies

3. Red Hat

Not able to run any command /lib64/ld-Linux-x86-64.so.2: bad ELF interpreter

Hi, I accidentally did this: wadhwaso@nxsdgd01 deps]$sudo rpm -e --nodeps glibc-2.5-107.x86_64 error: %postun(glibc-2.5-107.x86_64) scriptlet failed, exit status 255 and since then I am not able to run any command on this server except 'cd'. I always get the following error: $ ls... (6 Replies)
Discussion started by: stunn3r
6 Replies

4. Shell Programming and Scripting

bad interpreter when running script

Hi All, I'm not confortable in writing script, can someone can help me, when I run that script below i found this error code : -bash: ./script.sh: /bin/sh.: bad interpreter: Here is the script for i in * x=${i##*.} z=$(perl -e 'print time;') t=$(echo $z-$x|bc)... (12 Replies)
Discussion started by: bzb23
12 Replies

5. Shell Programming and Scripting

bad interpreter: Permission denied

Hi I am running a script: #!bin/bash set -x echo"select * from celldatamap;" || sqlcsv -v -h -s ',' -d MTNSA11G -u datasafe -p datasafe > andrea.csv When I run my script ./tablescript.sh I get the following error: $ ./tablescript.sh (3 Replies)
Discussion started by: ladyAnne
3 Replies

6. Shell Programming and Scripting

Executing expect script giving message as bad interpreter: Permission denied

Hi Gurus, I am new to scripting and needs your help in expect script used for telnet. I wrote a simple script as #!/usr/bin/expect-5.43 -f spawn telnet localhost 2233 expect "password:" send "secret\r" send "i data.cnbc.com\r" send "exit\r" expect eof When I am trying to execute... (2 Replies)
Discussion started by: niks_yv
2 Replies

7. Shell Programming and Scripting

Perl - bad interpreter: No such file or directory

Here is a puzzler. To start, let me say that I've done a search on this issue and it is definitely not related to line endings being encoded in windows returns. I get this error when I run SOME perl scripts. I have a script called hello_world.pl. I do $cp hello_world.pl new_hello_world.pl... (0 Replies)
Discussion started by: mjmtaiwan
0 Replies

8. Ubuntu

How to resolve bad interpreter error

Hi, Iam trying to run a gmake command and have the latest version of Gnu in my redhat linux system. I need to execute the following steps; ---> chmod +x utils/* ---> ./utils/AllCodeManagerFix ---> gmake LINUX Iam able to do the chmod command but when I run the second command I get... (2 Replies)
Discussion started by: viji19812001
2 Replies

9. UNIX for Dummies Questions & Answers

bad interpreter: Permission denied

I am writing an expect script but am getting a bad interpreter: permission denied error. I don't think the error has anything to do with expect itself, I think I am missing something in how I start the file. For instance, when I run the file under the expect directory it works: cd... (7 Replies)
Discussion started by: earnstaf
7 Replies

10. Shell Programming and Scripting

/bin/sh: bad interpreter: Permission denied

today i started the LFS book (version 4.0). Basically i am using slackware 9.0 to try and install a new linux completely from source on another partition. Now i took the book's recommendations and created a user called lfs so i wouldn't have to do the stuff as root, and i have got the new LFS... (4 Replies)
Discussion started by: Calum
4 Replies
Login or Register to Ask a Question