Skip to Content
Learning Shell Scripting with Zsh
book

Learning Shell Scripting with Zsh

by Gaston Festari
January 2014
Beginner
132 pages
2h 45m
English
Packt Publishing
Content preview from Learning Shell Scripting with Zsh

Expansion

The shell allows you to perform different types of manipulations right before executing a line. In the following section we'll learn how to take advantage of each of the different forms of expansion and substitution available in zsh.

Parameter expansion

Parameter expansion allows you to replace known variables in between the assignments of the command line. Simply put, parameter substitution is the mechanism by which the shell can change the following:

% foo=Hello

It will be changed to the following:

% echo "${foo}, world!"
> Hello, world!

Notice how the variable foo we declared in the previous line is replaced inside the arguments of echo with its actual value. You should be paying special attention to that peculiar ${} construction. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Zsh in macOS: Terminal Commands for Unix

Zsh in macOS: Terminal Commands for Unix

Karl Hadwen

Publisher Resources

ISBN: 9781783282937Supplemental Content