December 1999
Beginner
528 pages
11h 10m
English
To run several commands as a group effort all at once, the shell provides two methods. You can either run the group in the current shell or in a subshell.
To run a list of commands in the current shell, separate each command with a command separator, and enclose the list with round brackets.
The general format is:
(command1; command2; . . )
To run a command in the subshell do exactly the same but use {} instead of (). The general format is:
{command1; command2; . .)
I do not use these methods by themselves very often. The only time I use these grouping operators is in conjunction with the && or ||.
Going back to our comet script example, if the script comet failed I would probably want to execute two ...
Read now
Unlock full access