I would say that the only real problem with the ABSG is that it gets updated rarely and sporadically, so changes and bugs that have been fixed are not always reflected accurately. It's one of those documents that long ago reached a relatively complete state, and now only gets attention when absolutely necessary.
I'll agree that it's generally not the first place to send a newbie, except in regards to specific topics like this one, but it remains one of the most useful and detailed guides to bash scripting, IMO.
The semicolon list operator is exactly equivalent to a newline as a command terminator. When the first command terminates, the second command is executed. The following two sets of commands are identical:
nano ; gedit ; nano
are conditional sequencers. &&
executes the second command only if the first one terminates successfully (gives an exit code of 0). This is particularly useful if the operation of the second command depends on what the first command does. Take this example:
cd dir ; rm -f * #cd to dir, then run rm (unconditionally)
cd dir && rm -f * #cd to dir, and if successful run rm (otherwise do nothing)
Without the conditional operator, if the cd command failed (e.g. dir
doesn't exist), then you'd end up deleting everything in the directory you started in!
conversely executes the second command only if the first one exits unsuccessfully (exit code >0). This lets you specify an alternate command if something goes wrong with the first one.
cd dir || echo "Failed to change directories!"
And as explained, &
is a terminator that forks the command off as a background sub-process, and then frees up the terminal in order to immediately execute the next command. It's quite appropriate to use it in the way you posted; catkin
's caution was simply that you can't effectively background interactive commands that run directly in the terminal, like vim or nano. They simply get sent into the background in a suspended state and remain there until manually foregrounded or killed.