September 2018
Beginner
186 pages
4h 30m
English
We can define a function as a new name given to a saved compound command, which is run each time a command of that name is called. That definition is somewhat dense, so we'll break it down with some examples.
A simple function definition in one line to print our home directory might take the following form:
bash$ home() { printf '%s\n' "$HOME" ; }
This definition has a few parts:
Read now
Unlock full access