Oreilly - Linux Shell Scripting: Automating Command Line Tasks
by Paul Olushile | Publisher: Packt Publishing | Release Date: November 2018 | ISBN: 9781789131208
Solve complex shell-related problems and efficiently automate your day-to-day tasksAbout This VideoAvoid over-engineering; in most cases there is always a simple solutionUnderstand the internals; everything is based on simple conceptsLearn to debug and debug to learnIn DetailShell scripting involves writing a series of command for the shell to execute. It combines lengthy and repetitive sequences of commands into a single script, which can be stored and executed anytime. This reduces the effort required by the end user and the number of human mistakes.You will write your first shell script and delve into the shell, to touch the power CLI which provides against the GUI. Also you will learn simple arguments and use getopts to make it a real Shell command. Then you will learn looping and functions for performing complex operations. You will then master Regex and regular expressions to validate your arguments. Finally, you will learn to write logs correctly and fight the temptation to use I/O redirections.By the end of this course, you will be an expert at creating powerful shell scripts and will have explored the full possibilities of shells.
- Chapter 1 : Shell Is an Interpreter
- The Course Overview 00:02:44
- Shell Commands- Commands Are Built-In Scripts 00:08:38
- Documentation- Reading the Man Pages 00:03:37
- The First Shell Script – Using Shell Commands in the Scripts 00:05:07
- Calling the Shell Scripts – Different Ways to Call the Same Script 00:02:56
- Chapter 2 : Calling the Script with Parameters
- Variables – Passing Command-Line Arguments to a Script 00:03:32
- The First Argument – The Path of the Script 00:01:15
- The Order of the Arguments – Order Matters! 00:04:34
- Types of Arguments – Strings, Numbers, and Special Characters 00:07:08
- Parsing the Arguments – getopts 00:03:17
- Chapter 3 : Chaining and Redirection
- Standard Input and Output – Input and Output Redirection and EOF 00:06:56
- File I/O – Reading from a File and Writing to a File 00:04:40
- Detaching from the Shell – Screen Utility and the & 00:04:55
- Rewriting and Appending – The First Log 00:04:29
- Environmental Variables – Playing with the PATH 00:03:14
- Chapter 4 : Defining and Calling Functions
- The Functions – Function Is an Action 00:03:24
- Function Variables – Passing Arguments and Returning Values 00:04:13
- Variable Scopes – It Is Not the Same Everywhere 00:02:41
- Overloading – Redefining the Shell Commands 00:01:56
- Naming – Naming Conventions 00:02:23
- Chapter 5 : Looping and Branching
- Loops – for and while Loops 00:04:53
- Branching – if/then/else and Case 00:04:06
- Combining Loops and Branches – Nested Loops and Branches 00:01:32
- Branching and Arguments – An Example init Script 00:04:25
- Title 00:02:15
- Chapter 6 : Parsing and Regular Expressions
- Parsing – Check Whether It Is a Number 00:03:33
- Regex – Introduction to Regex 00:04:49
- Regex Flavors – It Is Not the Same Everywhere 00:01:46
- Globbing – Globbing Is Not Regex 00:03:36
- Practice – Practicing Is the Only Way 00:02:41
- Chapter 7 : Learning to Learn and Log
- Linux Logs – All Kinds of Logs 00:03:45
- Logging – Use Logger to Write Your Logs 00:03:01
- Reading the Logs – cut, tail, head, and grep 00:04:19
- System Calls – What strace Shows 00:02:43
- The Last Call – Putting It All Together 00:05:01
TO MAC USERS: If RAR password doesn't work, use this archive program:
RAR Expander 0.8.5 Beta 4 and extract password protected files without error.
TO WIN USERS: If RAR password doesn't work, use this archive program:
Latest Winrar and extract password protected files without error.