Book Image

Learning Shell Scripting with Zsh

By : Gaston Festari
Book Image

Learning Shell Scripting with Zsh

By: Gaston Festari

Overview of this book

Table of Contents (13 chapters)

Getting started with Globbing


Filename Generation, popularly known as Globbing (as in, Global substitution), is the ability of the shell to generate filenames from patterns. This is but the name for the process that allows the shell to read a pattern and generate a series of filenames; as a matter of fact, you might notice you have been using Globbing for quite a while in this book, the only difference is, we're now formally introducing the feature. Also, be aware that whenever we mention filenames in this text, it means both file and folder names, as you can use pretty much the same patterns to match both.

The really important thing you need to remember when dealing with Globbing is that filename substitution happens in the shell right before the line you typed is sent to the command. In other words, you type, zsh does the substitution, and only then sends the result, an expanded string and not whatever you just typed, to the function or program. There are ways around this, but just be...