The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
monitoring running processes nhatch Shell Programming and Scripting 2 12-21-2007 09:03 AM
running processes with no hang up yakyaj UNIX for Advanced & Expert Users 3 01-30-2007 10:18 AM
how to view loaded shared libraries by running processes in linux princelinux High Level Programming 3 01-17-2007 07:44 AM
how to find all processes that are running speedieB UNIX for Dummies Questions & Answers 9 07-12-2006 06:04 AM
getting certain info for all processes currently running Yifan_Guo High Level Programming 3 03-25-2005 07:53 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-09-2007
abcabc1103 abcabc1103 is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 6
Smile Running multiple processes in Linux

Hi guys,

I want to run the multiple scripts at the same time using a ksh script.

For example, I have three scripts to run:
a.ksh, b.ksh and c.ksh

How to start the above 3 scripts simultaneously and then on the completion of the above scripts I have other tasks to schedule.

Thanks
Gary
  #2 (permalink)  
Old 07-09-2007
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,763
Code:
a.ksh &
b.ksh &
c.ksh &
wait
This will work as long as the scripts do not write to the terminal.
  #3 (permalink)  
Old 07-09-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by jim mcnamara View Post
Code:
a.ksh &
b.ksh &
c.ksh &
wait
This will work as long as the scripts do not write to the terminal.
I would argue that it will work as long as they all don't want to read from terminal.
  #4 (permalink)  
Old 03-24-2009
robinbannis robinbannis is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 17
Hi,

I am doing a "rsync" to another machine and the arguments that i pass is shown below.

1. $HOME/Robin.ksh us
2. $HOME/Robin.ksh uk
3. $HOME/Robin.ksh in

How can i run all the three at the same time. Cant use "&" in this case.

Basically need to execute this at different shells.
Need to sync everything at the same time.


Regards,
Robin
  #5 (permalink)  
Old 03-24-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,877
Why not?
Code:
pl@desktop:~/testbed> cat test1.sh
#!/usr/bin/ksh
sleep 10
echo $1
pl@desktop:~/testbed> ./test1.sh ab
ab
pl@desktop:~/testbed> ./test1.sh cd
cd
pl@desktop:~/testbed> ./test1.sh ef
ef
pl@desktop:~/testbed> cat test2.sh
#!/usr/bin/ksh
./test1.sh ab &
./test1.sh cd &
./test1.sh ef &
wait
echo "All done"
pl@desktop:~/testbed> ./test2.sh
ab
ef
cd
All done
pl@desktop:~/testbed>
  #6 (permalink)  
Old 03-24-2009
robinbannis robinbannis is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 17
Thanks for you answer bro.

but
Can we give it with out SLEEP?
starting everything at the same time?
  #7 (permalink)  
Old 03-24-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,877
Of course. The sleep was in there for demonstration purpose only, since such a short script would finish before the next would be started. In order to demonstrate parallel execution properly, I had to delay them a bit.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 -4. The time now is 01:04 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0