O'Reilly logo

Mastering Bash by Giorgio Zarrelli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Functions

At this point of the book, we know enough to write our own code, process variables, interact with the user, and the environment, many things altogether, and so we are ready to make a mess. We know how to write a bunch of lines, but we still do not know how to keep things clean and tidy and, moreover, how to make our code reusable. As we can easily guess from the examples seen so far, a script or a command line is a one way processed flow of code; the characters making up our commands are read from left to right, from top to bottom. So, when you pass a construct or an assignment, it is done and if you want to process something the same way you did before; you have to rewrite the code that carried on the procedure again. So, if you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required