Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.
Thread: Shell Scripts iPhoneis a discussion within the
3rd Party Apps Requestsforums, a part of the
3rd Party Apps For iPhone | iPod Touchsection;
I am having trouble getting shell scripts working in the iPhone. Scripts of the type #!/bin/bash echo "foo" Do not work. I have set the permission correctly and tried changing...
09-17-2007, 12:12 AM #1Shell Scripts iPhone
I am having trouble getting shell scripts working in the iPhone.
Scripts of the type
Do not work. I have set the permission correctly and tried changing the first line to #!/bin/sh in addition to trying to run it in the default zsh.
09-17-2007, 01:17 AM #2
I wish I can help you. I was going to look into this for you, but I am having issues with term v100. I will try and get back to you when I get the darn thing working. Not sure why it stopped working for me. I used it the other day.
Very weird term v100 stopped working for me and Mobileterm works find for me now as it was having issues in the past. To try and help you further, how are you running your scripts? Are you running them in the directory the are located? Have you tried using ./scriptname and see if that works? Does it give you any error message or any thing in return?
Last edited by garretwp; 09-17-2007 at 01:22 AM. Reason: Automerged Doublepost
09-17-2007, 02:59 AM #3
hmm ... interesting ..
bash is owned by 'mobile' ...
I tried to chown the script ... but i got a 'memory exhausted'
so i checked with 'top' ... only 2.38 mb free
damn springboard ...Best Regards
09-17-2007, 06:12 AM #4
As far as I know a bash script wont run under zsh. I could be wrong though.
I have successfully changed the default shell to bash. with a working history, and .bash_profile. I'll post a how to after work. to give you a head start check out the dev team's website and browse for the CLI applications. Look under more unix stuff, and download the undated BASH shell. It works much better then the version that comes with BSD subsystem via installer. You can use it as the default in master.password without it crashing your phone.
ps. The only version of Terminal that seems to work (well at least) is the iterm branch version 153. you can get that here.
Last edited by mrengles; 09-17-2007 at 06:16 AM. Reason: Terminal NotesGratitude,
09-17-2007, 04:06 PM #5
I have tried from bash, tcsh, and even zsh.
When I run from bash this is what I get.
bash: ./scriptname: /bin/sh: bad interpreter: Permission denied
And also, yes, I would love to know how to set bash as the default. I will try to find the newer one.
09-18-2007, 10:00 AM #6
09-18-2007, 01:21 PM #7
The partition where the home directory is located is mounted with a noexec option.
remove the noexec option from the /private/var line in your /etc/fstab file, and reboot
The Following User Says Thank You to fezziwig For This Useful Post:
09-19-2007, 09:01 AM #8
09-19-2007, 10:33 AM #9
That fixed it! Thanks
09-21-2007, 09:19 PM #10
to install it do:
mv /bin/bash /bin/bash.original
cp /path/to/new/bash /bin/bash
then edit the /etc/master.passwd file and under the line that starts with root change the /bin/sh to say /bin/bash towards the end of the line..
note: open up a new ssh window to the phone to test it before closing the one you're in in case something went wrong and you can't get in, you can still fix it.