0

So, I have started studying UNIX systems about a month ago and now I have a basic question about job control

How can I create a job, that will contain several processes, using only default bash commands?

Daniil Zulin
  • 5
  • 1
  • 1
  • 6

2 Answers2

0

jobs are usually an interactive shell concept, as there is usually a controlling terminal involved.

A shell script is executed in a non-interactive, non-login session of shell, hence no job control by default.

You can force job control inside a script, by setting:

set -m

inside the script.

From help set:

-m Job control is enabled.

Aman Gupta
  • 400
  • 1
  • 9
  • Thank you, but my question was more about how to create custom job, that will include several processes without any scripts – Daniil Zulin Feb 26 '19 at 08:25
  • Same here in Indian College in which I'm studying. I am also second year student but want to study bash and UNIX for entering in cyber security field as it will be easy afterwards if I know it well. So please suggest something if possible :) – Aman Gupta Feb 26 '19 at 08:49
  • http://parallels.nsu.ru/~fat/unixsvr4-new/trunk/Irtegov-OS-Unix-System-Calls.pdf if you want to use some Google Translate – Daniil Zulin Feb 26 '19 at 08:57
  • do you have interest in going to cyber security field – Aman Gupta Feb 26 '19 at 08:59
0
echo | ping google.com &

Was fine example, because both of these processes work independently and only require pipe symbol (|) to work in sync in the background

Daniil Zulin
  • 5
  • 1
  • 1
  • 6