Programming

We mention earlier that the shell is the system’s command interpreter. It reads each command line you enter at your terminal and performs the operation that you call for. Your shell is chosen when your account is set up.

The shell is just an ordinary program that can be called by a Unix command. However, it contains some features (such as variables, control structures, and so on) that make it similar to a programming language. You can save a series of shell commands in a file, called a shell script, to accomplish specialized functions.

Programming the shell should be attempted only when you are reasonably confident in your ability to use Unix commands. Unix is quite a powerful tool and its capabilities become more apparent when you try your hand at shell programming.

Take time to learn the basics. Then, when you’re faced with a new task, take time to browse through references to find programs or options that will help you get the job done more easily. Once you’ve done that, learn how to build shell scripts so that you never have to type a complicated command sequence more than once.

You might also want to learn Perl or Python. Like the shell, Perl and Python interpret script files full of commands. But these two programming languages have a steeper learning curve than the shell. Also, because you’ve already learned a fair amount about the shell and Unix commands by reading this book, you’re almost ready to start writing shell scripts now; on the other hand, a programming language will take longer to learn. But if you have sophisticated needs, learning one of these languages is another way to use even more of the power of your Unix system.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.106.9