June 2025
Beginner to intermediate
1180 pages
37h 48m
English
This section deals with various mechanisms used by bash to process an expression composed of special characters into a new result. Consider the following examples:
GlobbingIf you type “cmd *.txt”, then bash searches all files corresponding to this pattern, such as readme.txt and copyright.txt, for example. What actually is executed then is cmd readme.txt copyright.txt. This means that bash replaced the search pattern with actual matching file names. This process is referred to as globbing.
Substitution/expansionSay that there is a variable named $name that contains the string “Peter”. If you now execute echo "Hello, $name!", then bash replaces the variable with its contents and prints “Hello, Peter!”. ...
Read now
Unlock full access