2 June 2025 Report - Day 8 - Basics of bash scripting
Content
I briefed with chapter 2 and 3 previous sections and then continued with the chapter 3 today. The topics I learnt are:
-
Shell Variables
Shell variables have a value associated with it. Undefined variable value is blank. -
Variables and Quoting
Variables require double quotes to preserve and ensure the correct evaluation of the variable value. -
Editing mode variables and some time stamp formats
-
Mail Variables
Some commands that I learned are:
- Syntax for defining variables
varname=value
- Use the dollar sign ($) before the variable name
echo "$varname"
- Use the unset command to remove the variable
unset varname
echo
command: Use to see value of variable
echo $varname
- Use time stamp format
HISTTIMEFORMAT="%y/%m/%d %T "
MAIL
: Add filename to check the mail in it
MAIL=filename