Lesson 10 - Writing Scripts
Lesson 10 - Writing Scripts
1. /etc/profile
2. $HOME/.bash_profile $HOME/.bashrc $BASH_ENV variable
3. $HOME/.bash_login
4. $HOME/.profile
Shebang sign
Commands Comment
Local variables
Silent reading
Command subtitution
Performing math
if [ condition ]
then
commands
fi
if [ condition ]
then
commands
fi
case variable in
pattern1) commands1;;
pattern2 | pattern3) commands2;;
*) default commands;;
esac
while [ condition ] ; do
commands
done
function name {
commands
}
Or
name() {
commands
}
Remove job
Command Description
$ crontab –l List all the entries on the cron table of your
user
$ export Set the EDITOR variable value to vi editor
EDITOR=vi for using when edit the crontab
$ crontab –e Edit the crontab with the EDITOR pre set