Visit Our UNIX and Linux User Community

Run Processes Sequentially Using Process ID (PID)

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Run Processes Sequentially Using Process ID (PID)
# 1  
Old 09-28-2009
Run Processes Sequentially Using Process ID (PID)


I'm a newbie when it comes to using UNIX, and I'm hoping someone here can help me out. I have a set of processes that I want to run sequentially:

I want to know I can run these sequentially using their process IDs (PIDs). Ideally, I want to create an alias called "after" so that I can run the processes as follows:

>> &
>> jobs
[1] 9736 Running &
>> after 9736 &

Do you know if there's a command or alias I can use to do this?

Thanks in advance!
# 2  
Old 09-28-2009
Please make use of code tags
 code tags

List them one after another in a wrapper and it's done. Is that what you are looking for.
# 3  
Old 09-30-2009
Thanks matrixmadhan.

Is there any way to do this via command line and PID, or do I have to use the wrapper? Ultimately, I'd like to run several processes in parallel, and then based on their PID, run sequential processes off of each parallelized process.

Previous Thread | Next Thread
Test Your Knowledge in Computers #729
Difficulty: Medium
BASIC stands for Basic All-purpose Symbolic Instruction Code.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to run scripts sequentially in background?

Hi , I have prepared the following shell script to run the hqls in background. These scripts are running Parallel but I want to run the hqls sequentially in background. cat >cc_script.ksh nohup hive -hiveconf rrdt=2016-06-12 -f /home/files/cust1.hql > home/log/cust1.log 2>&1 & nohup hive... (6 Replies)
Discussion started by: ROCK_PLSQL
6 Replies

2. Shell Programming and Scripting

Help with how to run multiple script with concurrent processes runs sequentially.

Hi, The problem detail is follows I have three individual scripts . SCRIPT A sh -x & sh -x & sh -x SCRIPT B sh -x & sh -x & sh -x... (1 Reply)
Discussion started by: H_bansal
1 Replies

3. Shell Programming and Scripting

Unix Script -- Suggestions to list and kill PID's sequentially

Hi, I'm trying to write a script where i'm trying to grep the PID and the associated file and list them. Then execute the KILL command sequentially on the listed PID's for ".tra" files ==================================================== ps -aux | grep mine adm 27739 0.2 0.8 1131588... (12 Replies)
Discussion started by: murali1687
12 Replies

4. Shell Programming and Scripting

Run multiple python programs sequentially.

Discussion started by: upvan111
2 Replies

5. Shell Programming and Scripting

Any scenario where a script will not run sequentially when called?

Can a script that calls another script exit and end while the called script is still running? If so, how can this be made to happen? (1 Reply)
Discussion started by: Harleyrci
1 Replies

6. Shell Programming and Scripting

Run a process but on a certain pid

Hi all, I am having a little bit of trouble trying to find something out. I am trying to script a start/stop php file, for some gaming servers i host. The server have 2 lots of processes running on them, and the customers need to be able to start and stop them at their will. So i know how to... (1 Reply)
Discussion started by: Syth
1 Replies

7. Shell Programming and Scripting

find pid of process run in specific location

Hello, I have a process a.out that runs from /a and /b How can I get the pid of the one running from /a ps -C /a/a.out does not work Thanks! (4 Replies)
Discussion started by: JCR
4 Replies

8. Shell Programming and Scripting

sequentially run the shell scripts.

Hi All, I have a master script , which would run 4 scripts in sequence. When the first script gets executed , I need to check if a particular process has been completed. If it is completed , only then proceed with the second script. This same rule applies to script3 and script4. Can someone... (4 Replies)
Discussion started by: nua7
4 Replies

9. UNIX for Dummies Questions & Answers

Need to get pid of a process and have to store the pid in a variable

Hi, I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this. Thanks in advance, Amudha (7 Replies)
Discussion started by: samudha
7 Replies

10. UNIX for Dummies Questions & Answers

Controlling processes knowing the PID's

Dear all, suppose that I start a process (named "father"). "father" starts in turns a process called "child" with an execv call (after a fork). In this way "father" will be notified if "chlid" crashes (SIGCHILD mechanism). The problem is: if "father" crashes, how can I do to be recreate a... (1 Reply)
Discussion started by: npalmentieri
1 Replies

Featured Tech Videos