Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 8. Shell Programming

Chapter 8. Shell Programming

Chapter Objectives

The meaning of variables and different types of shell variables

Writing shell scripts

Executing shell scripts

How to make shell scripts interactive using the read command

Positional parameters, their usage to read command line arguments and their manipulation

The exit status and performing various types of tests

Decision making and loop-control statements

Integer computing and string handling using expr

Performing real arithmetic

Debugging scripts

Recording a session using the script command

Having a working environment according one's taste using .profile


One of the important components of all Unix systems is the shell, which acts as a command processor as well as a programming language. We have chiefly seen it as a command processor in the previous chapters. As shell is a programming language too, one can write programs using it. Such programs are called shell programs. More often shell programs are referred to as shell scripts. This chapter primarily discusses how shell programs are written and executed. Many shell scripts that have been executed and tested have been included towards the end of this chapter.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint