The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 08-16-2007
manas_ranjan's Avatar
Registered User
 

Join Date: Jul 2007
Location: PUNE
Posts: 157
Is it possible ????

Is it possible to run 2 scripts in parallel thru shell script ?????

e.g. main1.sh and main2.sh needs to run parallel.
How can i achive this ?????

Any suggestions ....
Reply With Quote
Forum Sponsor
  #2  
Old 08-16-2007
Registered User
 

Join Date: Oct 2004
Posts: 235
it can be done by using FORK
Reply With Quote
  #3  
Old 08-16-2007
manas_ranjan's Avatar
Registered User
 

Join Date: Jul 2007
Location: PUNE
Posts: 157
Hi Arunkumar,

Thanx a lot...can you give me sample how to run main1.sh and main2.sh thru fork.....
Reply With Quote
  #4  
Old 08-16-2007
joerg's Avatar
Registered User
 

Join Date: Jan 2002
Location: Germany
Posts: 167
For simple things use this:

./script1.sh &
./script2.sh &



Thats all !
Reply With Quote
  #5  
Old 08-16-2007
Registered User
 

Join Date: Oct 2004
Posts: 235
AFIK the & will do a background run ..Not a parallel run .. You have to use fork .. to run the two code paralelly ..
Reply With Quote
  #6  
Old 08-16-2007
manas_ranjan's Avatar
Registered User
 

Join Date: Jul 2007
Location: PUNE
Posts: 157
yep joerg , by giving & it will run the scripts in Back ground..
by query is to run parallel, not one afteranother.

Arunkumar, Can u elaborate how can i use fork to run two scripts in parallel ......
Reply With Quote
  #7  
Old 08-16-2007
Registered User
 

Join Date: Oct 2004
Posts: 235
this
Fork (operating system - Wikipedia, the free encyclopedia)
will give you some idea's ...
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:18 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0