While reading documentation [1], the term "jobspec" appears a few times.
What is a jobspec?
[1] https://www.gnu.org/software/bash/manual/html_node/Job-Control-Builtins.html
$1 means an input argument and -z means non-defined or empty. You're testing whether an input argument to the script was defined when running the script. Follow this answer to receive notifications.
$(...) is an expression that starts a new subshell, whose expansion is the standard output produced by the commands it runs. This is similar to another command/expression pair in bash : ((...)) is an arithmetic statement, while $((...)) is an arithmetic expression. Follow this answer to receive notifications.
The disown command in Linux is used to remove jobs from the job table. You can also use it to keep a longer and more complex job running in the background even after you log out of the server.
Jobs are managed by the operating system as a single process group, and the job is the shell's internal representation of such a group. This is defined in POSIX as: A set of processes, comprising a shell pipeline, and any processes descended from it, that are all in the same process group.
The job control section of Greg's Bash Guide describes this as follows:
A job specification or "jobspec" is a way of referring to the processes that make up a job. A jobspec may be:
%n
to refer to job numbern
.%str
to refer to a job which was started by a command beginning withstr
. It is an error if there is more than one such job.%?str
to refer to a job which was started by a command containingstr
. It is an error if there is more than one such job.%%
or%+
to refer to the current job: the one most recently started in the background, or suspended from the foreground. fg and bg will operate on this job if no jobspec is given.%-
for the previous job (the job that was%%
before the current one).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With