Home User CP Donate Chat Register Today!  
  Get New posts Faq / Help?
   


Go Back   Hackint0sh > Projects and Hacks > iPhone > Applications & Development > Free Toolchain Software

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-13-2007, 10:00 AM
lolof
Status: Offline
Senior Member
 
Join Date: Aug 2006
Posts: 177
Rep Power: 12
lolof is on a distinguished road
Default script in Iphone

Hello,

I have write a small script a .sh file
I satrt it in the phone using mobileterminal.
My problem is that when I push the home butom to go in other app, the script stop working. I would like to have it still running when I go in other app.
How can I do this, is there other way to have my small script running when I work on the Iphone. Maybe I must do something other than a script .sh ???
Help is welcome.
Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 10-13-2007, 07:30 PM
dogzilla's Avatar
dogzilla
Status: Offline
Senior Member
 
Join Date: Aug 2007
Location: Boston
Posts: 106
Rep Power: 8
dogzilla is on a distinguished road
Default

you need to put a "&" at the end of your script's name when you call it. This will dissociate it from your terminal session and it will run till it finishes, you restart or you kill it. So if your script's name is "foo.sh", you would type

foo.sh &

That space before the "&" is intentional. Be careful - if your script goes haywire you won't know unless you know about ps or top ( hint: try typing "man top" in mobileterminal)
__________________
"Are you into S&M?"
"Well...I'm a Red Sox fan. Does that count?"
Go Sox!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 10-14-2007, 12:05 AM
lolof
Status: Offline
Senior Member
 
Join Date: Aug 2006
Posts: 177
Rep Power: 12
lolof is on a distinguished road
Default

Really a big big thanks.
Yes I know about ps and kill.
Thanks very much
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Sponsored links Remove advertisements
Advertisement
Advertisement

  #4 (permalink)  
Old 10-15-2007, 02:40 AM
vfxdude2
Status: Offline
Member
 
Join Date: Sep 2007
Posts: 45
Rep Power: 0
vfxdude2 is on a distinguished road
Default

You might need to use the unix command "nohup" It stops processes from being killed when a shell exits.

Ex.

nohup sh foo.sh &

(that is, if nohup is installed on the iPhone. I'm not sure if its a shell command or an executable. Maybe it's part of csh? I don't remember....)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 10-15-2007, 06:03 PM
vfxdude2
Status: Offline
Member
 
Join Date: Sep 2007
Posts: 45
Rep Power: 0
vfxdude2 is on a distinguished road
Default

Ahhh... yes. There is a nohup command on the iPhone. Probably gets installed as part of the BSD subsystem.

(If you want to know precisely what it does, check the man page on your Mac or Linux box)

-vfxdude
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +2. The time now is 06:23 AM.



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2 Ad Management by RedTyger
follow us on Twitter!

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105