O'Reilly logo

LPIC-1/CompTIA Linux+ Certification All-in-One Exam Guide (Exams LPIC-1/LX0-101 & LX0-102) by Robb Tracy

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

Chapter Review

In this chapter, you learned how to create basic shell scripts on a Linux system. A shell script is a text file that is interpreted and run by the bash shell. A shell script contains a series of commands that automate tasks and process information for you. A shell script is composed of the following parts:

• #!/bin/bash

• #Comments

shell commands

• exit 0

Shell scripts can be edited with any text editor. They can be executed in one of two ways:

• Entering /bin/bash script_filename.

• Adding the execute permission to the script file using the chmod utility and entering the filename of the script at the shell prompt.

In addition, you can also add the path to the script file to your PATH environment variable so users won’t have ...

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