5
My idea is to create a simple script that can search the PID of a process and kill it for example.
This is what I have done so far but has the problem that when running ps the PID will not be extracted.
echo "nome do processo : "
read $matança
ps -ax | grep $matança
you could pipe the result of your grep and use another grep to catch only the PID, something like:
ps -ax | grep $matança | head -1 | egrep '^\s*[0-9]+' -o
(head
is because your first grep will end up on the list of processes, and you just want the first). This is just an example to guide you, it’s nothing too robust.– BrunoRB
See also the command
killall ....
– JJoao