How to run bash?

To run bash program in your computer follow the instruction:

Step1: go to Desktop and create a file [you can use terminal/normally to create file]

Step2: copy and paste any one of my example code into your created  .sh extension  file.

Step3: go to terminal and follow the command

           cd Desktop           [go to the directory where your .sh extension file exist]

           chmod 755


Step: Now output of your code will show

Example1 (bash echo/ bash array example):

S=”Unix programming”
echo $S
Course=(CSE100 CSE103 MATH101)
echo ${Course[2]}
echo ${Course[*]}
echo ${Course[#]}

 Example2 (bash pipe):

$who(1)  wc-e|_|
Cal  a.jpg|d.jpg|c.jpg|b.jpg
a=’expr  $a+1’
b=’expr 4+10\*5’
check=’expr  $a\>$b’

Example3 (bash case example):

echo  “Type yes or no”
read a
case $a in y*|Y*)  echo  Yes!!;;
     n*|N*) echo No!!;;
     *) echo Wrong ans!!;;

Example4 (bash do while):

while read n
       echo You typed $n
       if [$n=”quite”]; then
       echo “quite)”