Shell Scripting
Shell Scripting
Session 4
Shell Scripting
Scripting Basics
• Shell scripts are text files that
contain a series of commands or
statements to be executed.
• It is useful for
– To automate
– Creating applications
– Perform system administration
Creating shell scripts
• Text editor vi is used to create a
text file containing commands
• Executing script
$ bash filename
read choice
echo "enter the num1 num2"
read n1 n2
case $choice in
1)echo "ADD : ` expr $n1 + $n2 `";;
2)echo “MUL : ` expr $n1 \* $n2 `”;;
esac
Thanks a lot for your attention !!