1
vote
5answers
75 views

Replace instance of process in place?

I suspect this is not doable just because of the security implications, but here's what I'd like to do. Basically we run a bash shell-script on our CentOS server that calls Program-A (in our case ...
5
votes
3answers
227 views

Using `kill -s 0 $pid` vs `[[ -e /proc/$pid ]]` to detect if PID is running

One of the idioms often used to check if process is running is to use kill -s 0 $pid. My question is, does it have any upsides over using [[ -e /proc/$pid ]] construct? The script I'm writing is ...
2
votes
2answers
913 views

Find the process id of a java application in a bash script (to see if the target application is already running)

I know there are a million questions on getting the process ID, but this one seems to be unique. Google has not given me the answer, so I hope stackexhange will help rather than close this question. ...
1
vote
2answers
610 views

multiple background processes in a script

Suppose if i have a situation in which some files need to be copied and it takes long time so i would have to go for parallel processing of the file copy. for example it may look like this for i in ...
4
votes
2answers
199 views

How can I synchronize processes started in different TMUX panes?

Consider this: tmux split-window -d program1 program2 # this program depends on some side effects produced by program1 In this case, program2 will start before program1 is ready. program1 will send ...
4
votes
1answer
171 views

Discard stdout of a command for t seconds

I am working on some batch scripts involving the following: Run some non-terminating sub-processes (asynchronously) Wait for t seconds Perform other task X for some time Terminate subprocesses ...