Getting ready

Besides having a terminal open, we need to remember a few concepts:

  • When a user logs off, any apps or processes owned by the current user will exit (the shell will send a signal)
  • The shell is configurable to not send a shutdown signal to processes
  • Applications and scripts use stdin and stdout for the usual operations
  • Applications or scripts in the background can be referred to as jobs

The purpose of this chapter is to not show you process management, but how we can manipulate the shell to keep our programs running. One neat way is by using &, which is used this way: $ bash runforver.sh &. Unfortunately, using only this technique, we are back at square one—our binary still dies when we exit. Therefore, we need to use programs ...

Get Bash Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.