Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.
iPhone / iPod Touch SDK | Development Discussionforums, a part of the
3rd Party Apps For iPhone | iPod Touchsection;
how can i execute scrips to be run in terminal. (on the iphone) im using the sendsms code line, and im having this competition with a buddy of mine irrelevent...
08-03-2009, 12:35 PM #1
how do i run a script in terminal.
how can i execute scrips to be run in terminal. (on the iphone)
im using the sendsms code line, and im having this competition with a buddy of mine
i needsendsms 55555555 "hey"
preferably stop at around 20 or 30.
so i dont get stuck in a loop.
anyone know how i can do this?
any help is appreciated
btw wer having a competition as to who can send the most texts in half an hour
and at no time did anyone say anything about automated sending
08-03-2009, 02:18 PM #2
Your title question is not the same as the question in your message. So I will only answer the title quesion:
chmod 755 program
08-03-2009, 05:42 PM #3
Well that's almost no help...
08-06-2009, 08:12 AM #4
Since the iPhone uses the Bourne Again SHell just look the command in a .sh script. Chmod it to +x and run ./script.sh
while [ -lt 20 ]
sendsms 55555555 "hey" &
The Following User Says Thank You to boxxa For This Useful Post:
08-06-2009, 02:24 PM #5
Ok so I make
a spript file named whatever.sh
containing what you quoted
and then just put it on the phone and run it with terminal?
I'm on the iPhone. Sorry about the spelling****
Last edited by JustinPizzle; 08-06-2009 at 02:24 PM. Reason: Automerged DoublepostIf i helped you, clicking thanks would be nice
08-06-2009, 02:31 PM #6
08-06-2009, 08:34 PM #7
haha im going to try it right now.
ok well the .sh file runs. but nothing happens.
it just returns like it was successful and then theres nothing...
and yes, i did replace the 55555555 number with my own.
Last edited by JustinPizzle; 08-06-2009 at 08:34 PM. Reason: Automerged DoublepostIf i helped you, clicking thanks would be nice
08-06-2009, 09:40 PM #8
Take out the & after the sendsms command and see what the output is. Do u have the sendsms package installed from cydia?
08-06-2009, 09:59 PM #9
how should i go about making the .sh file.
ive tried with text edit and apple scrip editor
and removing the & still is a no goIf i helped you, clicking thanks would be nice
08-07-2009, 07:29 AM #10
Use vi or make it on your computer and upload it to the phone. Its just a text file.
if you run sendsms "5555555555" "Test" from the terminal does it work? Make sure you get sendsms working properly before you worry about the script.
08-07-2009, 12:04 PM #11
yup. it works fine without the script.
i make it with text edit. save as "sh.rtf"
then remove the "rtf"
and upload it onto the phone.
then all the commands you said, down to the letter
it runs, no errors but no sms is sentIf i helped you, clicking thanks would be nice
08-10-2009, 06:33 AM #12
Well I am a Java programmer not a scriptor but you can solve the problem in a similar fashion. First thing I would do is eliminate the possibility of it being a communication problem with sms and instead of the sms command put in 'echo blah blah' and see if blah blah prints. If not then you know you arent ever going in the loop.
Secondly why do you need to wait for it to finish sending before you try sending again anyway? I mean realistically you could make it an infinite loop that is stopped by some command. That is clearly not the 'best practices' approach however you are trying to win a bet not a nobel prize lol. My guess is that by sending them continuously one after another with no delay sms will error out whatever it cant process but it wont matter because while it is giving you error messages it is still processing the script. One thing I would test before doing something that crazy though is put a 1 sec delay in between them and see if accepts them. I dont know how it works but perhaps the app will queue what you are trying to send and if that is the case you will most likely overflow your buffer and crash your phone altogether if you have no delay and continuously do it for 20-30 minutes. So I would test like 10 seconds with 1 sec delays in between and see if you get 3 messages or 10.
08-10-2009, 07:34 AM #13
Ya its probably flooding the SMS command and dropping it.
Try this version:
while [ -lt 10 ]; do
sendsms 5555555555 "hey"
08-10-2009, 09:37 PM #14
again I am no scriptor but I thought Id point out in the first script there is no semi colon after the while statement where as in the second one there is. Perhaps the first script was not executing because of a syntax error? Also the keyword let is missing from the first script. Again I dont know for sure but I am just comparing the 2 different scripts.
08-11-2009, 10:40 AM #15
I typed both of those from memory. Here is a working script that I tested on a linux box. THe only difference between this one and the one I tested was that I just echoed a command instead of running sendsms since my server doesnt have a sendsms command.
while [ -lt 10 ]; do
sendsms "5555555555" "hey"