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
  • 77,979
  • 13
  • 71
  • 125
exebook
  • 29,722
  • 29
  • 120
  • 210

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,009
  • 10
  • 36
  • 50