0

How can I exit a bash script without interrupting its running state? Say that I've launched the bash script and then realized that it's going to run longer than I initially thought, so I want to leave it in the background and do other stuff.

There are options like:

  • CTRL-C -> Doesn't work, because I want the script to run in the background.
  • exit 0/1 -> Doesn't work, because I have to edit the script - can't do it while it's running

Any tips would be welcome!

Thanks

terdon
  • 98,183
  • 15
  • 197
  • 293
sudo
  • 1
  • Just press Ctrl+Z. See [How to send a process to background and foreground?](https://askubuntu.com/q/819924) or [Running programs in the background from terminal](https://askubuntu.com/a/106910) or [I can't use the terminal while gedit command is running](https://askubuntu.com/q/319843). – terdon Nov 24 '22 at 13:12

0 Answers0