0

Can you kill the process int he bash script without knowing the PID, and only knowing the bash job ID (obtained with jobs for example)?

jobs
[1]+  Stopped                 python

I can have multiple python executables running, so killall python is not an option.

Cyrus
  • 84,225
  • 14
  • 89
  • 153
exebook
  • 32,014
  • 33
  • 141
  • 226

1 Answers1

0

As far as I know, kill only works for PIDs. What I would recommend you is to keep the PID after running your script:

./some_script &
script_PID=$!

After that you can use killas usual.

elcortegano
  • 2,444
  • 11
  • 40
  • 58