From the course: Learning Zsh

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Scripting

Scripting - Unix Tutorial

From the course: Learning Zsh

Start my 1-month free trial

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