Chapter19.Shell Scripts

team bbl


Chapter 19. Shell Scripts

Shell scripts are text files containing commands. The use of commands at the command-line interface is explained in Chapter 7, including their syntax and capabilities. The same commands, using the same syntax, can be stored in a shell script. When you run the script, the commands are executed, one by one, starting from the beginning, just as if you were typing them directly into the shell yourself, one by one. Often you can save yourself a great deal of typing by putting commands you enter frequently into shell scripts.

Shell scripts are often used to perform routine system maintenance tasks. For instance, you might write a shell script that backs up specific files to another computer on your network. Or you might want to rename all the files in your directory. Or you might want to edit all the files on your company Web site by changing your company address from an old address to a new address.

This chapter explains how to write shell scripts. This chapter is an introduction to shell scripts that doesn't begin to show the advanced power provided by shell scripts. You can learn how to create uncomplicated shell scripts for everyday tasks; if you want to do advanced shell scripting, however, you need to read a more complete treatment of the subject. Complete books are written about shell scripting.

Commands are not explained in this chapter. Chapter 7 explains the syntax of using commands. Appendix B provides a reference, with details, of the most useful commands.

    team bbl



    Spring Into Linux
    Spring Into Linux
    ISBN: 0131853546
    EAN: 2147483647
    Year: 2005
    Pages: 362
    Authors: Janet Valade

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net