Toggle navigation
FreeKB
About
Walkthroughs
Linux Commands
Sign In
FreeKB - Bash Shell Scripting articles
Bash Shell Scripting articles
Arrays
Getting Started with Arrays
Append values to an array (+=)
Count values in an array
Command Line Options and Flags
Command line options flags arguments (case statement)
Email
Send a daily email (cron)
Files
Create Excel or CSV file
Functions
Getting Started with functions
if elif else then
if, elif, else, then statements
IFS (Internal Field Separator)
IFS (Internal Field Separator)
Loops
for loops
Move onto next value in a loop (continue)
select loops
while loops
Math
Addition
Division
Multiplication
Subtraction
Printing
printing bold text
Regular Expressions
Add a leading zero to single digit numbers in Linux
append new lines to a file or variable
carriage returns (\r ^M)
do something empty lines
do something every nth match
do something every other match
do something forward slashes
do something last match
do something match does/doesn't begin with pattern
do something match does/doesn't end with pattern
do something pattern match
do something range match
grep previous or next match
inline text (paste command)
newlines \n
replace string in file
uppercase or lowercase (tr command)
whitespace \s
wildcard character
Script interpreter
Understanding script interpreter
SSH
Getting Started with SSH
Variables
append values to a variable (+=)
join lines in a variable
join lines in different variables
local and remote variables with SSH
remove duplicate values from a variable
remove new lines from a variable
replace values in a variable