northcurlcurl
Programmer
Hi,
I've written a basic shell script to stop a process (kill -TERM "$pid", where $pid is an variable that stores a processs id) on my Linux host. It seems like the script exits without an error and completes within a second. But when I issued ps -ef command after the script was completed, the process id I specified in the shell script was still there. I have even written another script to check if the process id I specified in the first script but it couldn’t catch the process. After while, I issued acctcom and the process was running for about 2 min 30 sec…I basically have two questions for this problem.
1. when a command is executed in a script, does a shell start executing next line of command without waiting for the result of the first command?
2. how come kill -TERM "$pid" was successfully executed but ps –ef command showed the process supposed to be terminated?
I guess my Unix knowledge is very limited and this question might be too basic to be asked in this forum. But I'm struggling with this problem for ages... Would you please help me out!!!
Thanks in advance,
Ryosuke
I've written a basic shell script to stop a process (kill -TERM "$pid", where $pid is an variable that stores a processs id) on my Linux host. It seems like the script exits without an error and completes within a second. But when I issued ps -ef command after the script was completed, the process id I specified in the shell script was still there. I have even written another script to check if the process id I specified in the first script but it couldn’t catch the process. After while, I issued acctcom and the process was running for about 2 min 30 sec…I basically have two questions for this problem.
1. when a command is executed in a script, does a shell start executing next line of command without waiting for the result of the first command?
2. how come kill -TERM "$pid" was successfully executed but ps –ef command showed the process supposed to be terminated?
I guess my Unix knowledge is very limited and this question might be too basic to be asked in this forum. But I'm struggling with this problem for ages... Would you please help me out!!!
Thanks in advance,
Ryosuke