More on this book
Kindle Notes & Highlights
by
Jason Cannon
Read between
December 18 - December 29, 2021
You can access all the positional parameters starting at $1 to the very last one on the command line by using the special variable $@.
The special variable $? contains the return code of the previously executed command.
The command following a double pipe will only execute if the previous command fails. If the first command returns a non-zero exit status, then the next command is executed.
Note that it's a best practice to place all of your functions at the top of your script. This ensures they are all defined before they are used.
If a global variable is defined in a function, it is not available outside that function until the function is called and executed.
Use the local keyword before the variable name. Only use the local keyword the first time the local variable is used. Note that the local keyword can only be used inside a function.
The special variable $$ represents the PID of the currently running shell script.

