I try use this command:
start "" putty.exe -ssh -load NameOfSessionInPutty -m "C:\Program Files\PuTTY\MYCOMMAND.txt" -t
MYCOMMAND.txt contains:
sudo su - -c "kill `ps -ef | grep 1.sh`"
But the above command kills only 1 line (first that it finds),
and I need to find and kill ALL processes with this name 1.sh.
When I do this manually:
kill `ps -ef | grep 1.sh`
it works perfectly, killing all processes with this name.
But sudo su - -c "kill `ps -ef | grep 1.sh`" kills only the first one found and closes the session.
Help, please, whoever understands what I need to change in the code.