Linux Bash Shell Programming
Course
In London-City
Description
-
Type
Course
-
Location
London-city
The Linux Bash Shell Programming course is designed to give delegates practical experience in developing and writing Bash shell scripts. Most of the built-in shell commands are introduced together with the main program control structures. The course also gives practical experience using a range of Linux tools to manipulate text and incorporate into Linux Bash shell scripts. Who will the Course Benefit? Programmers, developers and system administrators who need to construct shell scripts using advanced text handling facilities. The Linux Bash Shell Programming course assumes knowledge of the Linux Operating System to the level covered in the Linux Introduction Course. Some programming experience may also prove advantageous. This 5-day Linux Bash Shell Programming course is a combinatiion of the Linux Shell Programming and Linux Advanced Shell Programming Tools courses. If the dates allocated to this 5-day course are not suitable, then this course can also be booked by selecting dates from both the Linux Shell Programming and the Linux Advanced Shell Programming Tools courses. The Shell Programming course should be attended first and may start on either a Monday or a Thursday. Learning Objectives To provide the skills needed to develop and customise shell programs and to make effective use of a wide range of standard Linux programming and development tools. The delegates will practise: Writing simple scripts to enhance basic command outputUsing the various shell quoting mechanisms appropriatelyManipulating shell variables and user-defined variables in scriptsImplementing conditional execution facilitiesUsing the shell's built-in loop constructs where appropriateWriting scripts to trap user interruptsUser defined FunctionsDeveloping menu-driven shell scriptsBacking up and restoring files with tarFile compressionScheduling background jobs with crontab and atComparing file contentsSplitting filesIdentifying and translating charactersReview of regular...
Facilities
Location
Start date
Start date
About this course
Pre-Requisite Courses
* Linux Introduction
Reviews
Subjects
- Programming
- Writing
- Linux
Course programme
Course Contents - DAY 1Course Introduction
- Administration and Course Materials
- Course Structure and Agenda
- Delegate and Trainer Introductions
- Basic UNIX commands
- Filename generation characters
- Redirection and pipes
- What is a shell script?
- Development guidelines
- Creating and editing shell scripts
- Naming and storing shell scripts
- Executing shell scripts
- Exercise: Create and run a simple shellscript
- Environment variables
- Local variables
- Assigning values to variables
- Accessing variable values
- Using quotes
- Delimiting variable names
- echo control sequences
- Exercises: Use variables in shellscripts
- Using the expr command
- Using the (( )) notation
- Exercises: Use integer arithmetic in shellscripts
- The read command
- Command line arguments and related variables
- Exercise: Writing an interactive shell script
- The if-then-elif-else statement
- String tests
- Integer tests
- Filename tests
- Other test notations
- Default and substitute variables
- Exit status codes
- Counting characters
- Testing for numeric input
- Exercise: Add validation to previous scripts
- The while loop
- The until loop
- The while true and until false loops
- The for loop
- Loop control commands
- Exercises: Enhance the previously written scripts with loop constructs
- The case statement
- Patterns and actions
- Menu driven applications
- Exercise: Develop and write a menu system
- What is a function?
- Function syntax
- Exercises: Create and use functions
- Interrupt signals
- The trap command
- Abnormal termination of scripts
- Exercise: Adding traps to the menu script
- The exec command
- The includes notation
- Arrays
- Here Documents
- Exercise: Enhance scripts
- The tar command
- Compression utilities gzip, bzip2, zip and compress
- Exercise: Backing up and restoring files using tar
- Exercises: Compressing files
- Scheduling jobs with the cron command
- Scheduling jobs with the at command
- Exercises: Running background jobs
- Compare two files with the cmp command
- Compare two files with the comm command
- Compare two files with the diff and sdiff commands
- Compare large files with the bdiff command
- Exercises: Identifying file differences
- The split and csplit commands
- Exercises: Splitting files
- od - octal dump
- Use cat to display non-printing characters
- The expand and unexpand commands to convert between tab and space characters
- The tr command for character translation
- Exercises: Translating characters with tr
- Standard regular expressions
- Extended regular expressions
- sed command line syntax
- sed command processing
- Pattern space
- sed addresses
- sed commands
- Hold and get functions
- Advanced flow control
- Exercises: Text processing with sed
- Introduction and command line syntax
- The awk program structure
- Operators
- Simple patterns
- Extended patterns
- Special patterns (BEGIN and END)
- Program variables: Built-in variables, User defined variables, Arrays
- Mathematical operators
- Displaying output with print and printf
- Exercises: Create awk scripts to extract selected data from a file and generate reports
- Program control structures
- The if construct
- The while and do ... while constructs
- The basic for construct
- Associative array handling
- Functions: Mathematical and string functions, The system function, The getline function, User defined functions
- Exercises: Create an awk script using an program control structures and arrays
- Responding to Syntax errors
- Responding to Logical errors
- bc (calculator)
- fuser (testing for files in use)
- getops (checking options passed to shell scripts)
- printf (formatting screen output)
- logger (script logging)
- xargs (generating arguments for a command)
- eval (re-evaluating variables)
- Exercises: Using tools within a shell script
Linux Bash Shell Programming