From the course: Learning Zsh
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Scripting
- [Instructor] A script is text file that contains one or more commands. While it's fine to use Z shell interactively typing one command at a time, it can also be useful to create programs or tools made up of a series of commands in order to speed up work, reduce typographical errors, and replicate complex processes in an easy way. Let's take a few minutes to take a look at the basics of creating scripts in Z shell. To start, I'll open up a text file here on my system and I'll add a line here. R at echo, "Hello from the script!" I'll save that and exit the editor. And now, I can tell Z shell to run the script by typing zsh and the name of the script file. And there's the output. Okay, that's not very exciting. But, we have a script, and we can send it to other Z shell users and they can run it the same way and see the same output. Let's make a script that's a little bit more interesting. Scripts are very…
Contents
-
-
-
-
Autocd and cd shorthand4m 15s
-
(Locked)
Directory stack and user dirs4m 17s
-
(Locked)
Finding files and commands3m 59s
-
(Locked)
Autocompletion4m 52s
-
(Locked)
Redirection and multios6m 14s
-
(Locked)
Command history4m 24s
-
(Locked)
History shell variables2m 11s
-
(Locked)
Expansions8m 20s
-
(Locked)
Renaming files with zmv7m 29s
-
(Locked)
Scripting5m 29s
-
-
-