I have a task to stop a running process and run it again with the very same command it was run previously with.
In a nutshell, I need to change the configs of the running program and restart it to apply changes.
I have a program.pid file where the application stores its PID. A ps
program on my setup doesn't have a -p
or alike flags.
What I want to do is to ps | grep
by the PID I get by more program.pid
.
The question is how can I put in the result of the second command into the first as the second parameter of grep
?