CHAPTER 13

Writing Shell Scripts

In this chapter, you will learn about

•   Understanding shell script components

•   Using control operators

•   Processing text streams

This chapter covers how to create and control basic shell scripts on a Linux system. Shell scripts are text files that contain a variety of commands that can be used to automate tasks and process information.

Images

NOTE   Most of the scripts found in this chapter can be found on the image provided with the book in the directory /Labs/Chapter_13.

Understanding Shell Script Components

A script is a series of commands that are interpreted and executed by a shell.

Shebang (#!)

The first ...

Get CompTIA Linux+ Certification All-in-One Exam Guide: Exam XK0-004 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.