Learning Linux Shell Scripting
Subtitle: Leverage the power of shell scripts to solve real-world problems, 2nd Edition
Edition: 2nd ed.
Publisher: Packt Publishing
Published: 2018
Place of publication: Birmingham
Language: eng
Number of pages: 325
ISBN-13: 9781788991537
Subjects: Scripting languages; COMPUTERS; Operating Systems; Linux
Description: Linux has been one of the widely adopted and popular OS when it comes to leveraging scripting and automating common tasks. With this book, readers will get to grips with shell scripting, automating repetitive tasks, text processing, regular expressions, pattern matching, backup and restore, and much more. The end goal of this book is to get ...
Table of contents: title: Cover; Title Page; Copyright and Credits; Dedication; Packt Upsell; Contributors; Table of Contents; Preface; Chapter 1: Getting Started and Working with Shell Scripting; Comparison of shells; Tasks done by the shell; Working in the shell; Learning basic Linux commands; Our first script; title: Hello World; When not to use scripts; Various directories; Working with permissions; Changing file permissions; The chmod command; Technique one; title: the symbolic method; Technique two; title: the numeric method; Setting umask; Setuid; Setgid; Sticky bit; Summary.; title: Chapter 2: Drilling Deep into Process Management, Job Control, and AutomationIntroducing process basics; Monitoring processes using ps; Process management; Process monitoring tools; title: top, iostat, and vmstat; Understanding ""at; Understanding crontab; Summary; Chapter 3: Using Text Processing and Filters in Your Scripts; Text filtering tools; Head and tail; The diff command; The cut command; The paste command; The join command; The uniq command; The comm command; The tr command; The sort command; IO redirection; File descriptors; Redirection; Brace expansion.; title: Pattern matching with the vi editorPattern searching using grep; Summary; Chapter 4: Working with Commands; Learning shell interpretation of commands; Checking and disabling shell internal commands; The exit status; Command substitution; Command separators; Command1; command2; Command grouping; Logical operators; Command1 & command2; Command1 & & command2; Command1 || command2; Pipes; Summary; Chapter 5: Exploring Expressions and Variables; Understanding variables; Working with environment variables; The local variable and its scope; Exporting variables; Working with read-only variables.; title: Working with command-line arguments (special variables, set and shift, getopt)Understanding set; Understanding shift; Resetting positional parameters; Understanding getopts; Understanding default parameters; Working with arrays; Creating an array and initializing it; Accessing array values; Summary; Chapter 6: Neat Tricks with Shell Scripting; Interactive shell scripts; title: reading user input; Summarizing the read command with options; The here document and the <<operator; The here operator with the sort command; The here operator with the wc command; The utility ed and here operator.; title: A script for sending messages to all logged-in usersUsing the <<here operator for FTP usage and data transfer; Turning off variable substitution; The here string and the <<<operator; File handling; Introducing file handling; Using exec to assign a file descriptor (fd) to file; Understanding the opening, writing, and closing of a file; Understanding reading from a file; Understanding reading and writing to a file; Using the read command on a file descriptor (fd); Reading from one file and writing to another file; Displaying the file descriptor information from the /proc folder.; title: File handling; title: reading line by line.