Chapter 12. Shell Scripting and Programming

Chapters 10 and 11 explained how to interact with Linux at the command prompt. This interaction took place one command at a time, with commands processed as soon as you pressed the Enter key.

This chapter shows you the next step: how to schedule commands for processing in the future and how to batch commands together in scripts for processing. These commands are called shell scripts because they use the syntax and language built into Linux's bash shell. The analogy in the Microsoft Windows world is to DOS batch files—but shell scripts are more powerful and easier to write. You can think of shell scripts as comprising an extended macro language that works with the operating system.

In this chapter, I'll explain the basics of how to schedule commands for future processing. Then I'll show you how to create and run simple shell scripts.

If shell scripting doesn't provide the capabilities you need, you can use one of the many development languages bundled with Red Hat 6 Linux. I'll provide overviews of some of the most popular languages: Awk, Perl, Python, and Tcl.

A final bonus for users of Linux is, of course, that the Linux source code is included. I'll show you a fascinating way to idle away those long empty hours: viewing the source code for the Linux kernel!

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

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