September 2018
Beginner
186 pages
4h 30m
English
Arrays are especially useful when used to contain expanded globs:
bash$ myhomefiles=("$HOME"/*)
bash$ printf '%s\n' "${myhomefiles[@]}"
/home/bashuser/code/home/bashuser/docs
/home/bashuser/music
/home/bashuser/Important Notes.txt
/home/bashuser/**README**
The myhomefiles array defined here contains a list of all files and directories matched by the * glob in our home directory, and stores them safely, even if they contain special characters, such as spaces, asterisks, or even newlines.
Read now
Unlock full access