0

I have a script that invokes the play command when I press f10. I would like to edit that script so if I press it while an audio file is playing, then it kills that first before playing the next file.

What command am I looking for? Something like,

killall play ?

muru
  • 197,895
  • 55
  • 485
  • 740
Anon
  • 12,063
  • 23
  • 70
  • 124

1 Answers1

3

Well, as you already intuitively thought, killall play is the way to go.

What it does is to terminate all running processes with the name "play" by sending them the signal SIGTERM.

You can read more about it in its manpage by typing man killall or visiting it online.

Byte Commander
  • 107,489