
Learn how user home directories under /home are configured and managed by /etc/profile and per-user files like .bash_profile, .bashrc, and .bash_logout for login and interactive shells.
Learn how to define and read bash variables, including environment and system variables, assign values, perform arithmetic, and understand their local scope to a shell.
Create a simple Bash script using only echo commands to gather system information, including disk space, memory, uptime, load, and logged-in users, with proper variable rules and permissions.
Explore how IFS, the internal field separator, splits a variable into sub variables and how the read command assigns city1, city2, and city3 from a list.
Master wildcards in bash by learning how the asterisk matches any string and the question mark matches a character. Use patterns to match .conf and .txt files, starting with r.
Learn to colorize bash script output using echo -e and escape sequences. Apply foreground and background color codes, reset with the closing sequence, and create clearer, readable scripts.
Join a lab on bash colors using echo -e to interpret escapes, applying foreground codes like 31 red, 32 green, 34 blue, and background 41 and 42, and underline 4m.
Create a bash script that detects linux distribution with uname -s and release files like RedHat, CentOS, SuSE, Mandrake, and Debian, printing the result in color.
Practice bash scripting with if else. Learn to verify a password with silent input -s and use elif for odd, even, or zero checks.
Learn how to check a command’s exit status in Linux, where zero means success and non-zero signals failure; use the $? variable to print it in shell scripts.
Explore a bash practice lab that uses exit status to verify file creation with touch, handles permission errors between root and normal users, and demonstrates error suppression through redirection.
Master linux process management with ps -ef, examine pid, ppid, cpu, and start time from tty or pts, and note that a question mark in tty signals no terminal.
Lab session demonstrates writing a bash function identify to determine if an argument is a file, directory, or symbolic link using -f, -d, -L, with argument checks.
Learn the difference between local and global variables in shell scripting, with examples showing how A, B, and C behave inside and outside functions.
Use awk with a BEGIN block to print headers, then display fields $1 through $5, and insert tab characters \t to align columns, producing a formatted report.
Master awk postprocessing in linux shell scripting by printing file contents with print $0, prepending text with begin and appending a report with end, and using a test variable.
Learning is important but most important is how to explore it. This course is designed in such a way that you can learn as well as explore the entire course module with various industrial projects.
Practical approach to learn and explore the shell scripting with various industrial projects
Course Content
Introduction of Shell Programming
What is Bash Shell?
Types of Shell available in Linux
About Shell Scripting
Bash Shell Startup Scripts
User’s Home Directory - .bash_profile, .bashrc & .bash_logout
Shebang
Create a simple Shell Script
Setting up permissions on a script
Debug a Script
The Shell Variables & Environment
Bash Variables
Environmental Variables
System Variables
Assign values to shell variables
Customize the bash shell environments
set, env & export command
Rules for naming variable name
Simple Script using echo command
Quoting
There are three Type of quoting
The double quote (")
The single quote (')
The Backslash (\)
User's Input via Keyboard
Read Command
IFS
Practice Lab Session
Arithmetic Operations
Performing Arithmetic Operations
Create an integer Variable
Create the Constants Variable
Path name expansion
Wildcards [*], ?, [..] etc
Create & use aliases
Practice Lab Sessions
Industrial Project to Completely Automate the Pre-validation report
A Shell Script to collect required information from a server
The Bash Color
Writing Color Text
Various Color Codes for Foreground & Background Text
Lab Session on Bash Color
Script to fetch the system information i.e system_details
Schedule the script via cron
Final Script to fetch the environment report on a single click
Lab Session
Conditional Statements (Decision Making)
Overview of conditional execution
What is Condition?
Boolean value (True & False)
If else statement
Lab Session on if..else..
if..elif..else..fi statement
test command
Logical AND &&
Logical OR !!
The exit status of a command
Numeric Comparison
String Comparison
File Attributes Comparison
Shell Command line parameters
Positional parameters via special shell variable $1, $2, $3,...,$N.
Practice Lab Session
Bash Loops
Overview of loop statement
for loop statement
Lab on for loop
for loop using C like Syntax
for loop using command line arguments
Nested for loop statement
Chessboard using nested loop statement
While loop statement
Lab Session - read a text file line-by-line or using IFS
infinite while loop
case statement
Lab session on case statement
Create a simple menu driven program or automation tool Using Case Statement
Industrial Project
Discussed various scripts using for or while loop
Shell Redirection & Process Management
Input Output Redirection in Linux
Lab Session on redirection
Pipelines in Linux
tee command
file descriptor (fd) to file for output
file descriptor (fd) to file for input
file descriptor (fd) for reading & writing
Practice Lab Session
Overview of a Process
Foreground & background Process
Various Stats of a process
Lab Session
Functions
Defining functions
Displaying functions
Nested functions
Lab Session - writing functions
Calling functions
Local & global variables
Passing arguments into a function
return statement
Practice Lab Sessions
AWK
Introduction Awk
Pattern matching
User defined variables in awk
Awk pre-processing
Awk post-processing
Practice Lab Session
SED Stream Editor
Introduction
Replacing or substituting string.
Replacing the nth occurrence of a pattern in a line
Replacing all the occurrence of the pattern in a line
Changing the slash (/) delimiter
Using & as the matched string
Duplicating the replaced line with /p flag
Replacing string on a specific line number
Replacing string on a range of lines
Replace on a lines which matches a pattern
Deleting lines
Add a line after a match
Add a line before a match
Last Lecture