

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


$cat my_script.sh clear echo "This is my first shell script." echo "Today’s date is date | cut –d " " –f 1–3" echo "Now the time is date | cut –d " "–f 4" echo "GOOD LUCK" $ output $sh my_script.sh This is my first shell script. Today's date is Tue Nov 26 Now the time is 13:05: GOOD LUCK $
$cat readname.sh echo what is your name ? read name echo The name is $name. output : $chmod u+× readname.sh $readname.sh what is your name? murthy Example 4 $cat example echo Input a value for x read x echo the value of x is $x readonly x x=expr $x + 1 echo The value of x now is $x output : $sh example Input a value for x The value of x is 4 example: line 5: x: readonly variable