Topic 2: Example: Comments in Shell Scripts #Linux/Unix: Shell Programming – 001

bash-3.2$ cat scriptwithcomments.sh
#!/bin/sh
# This script clears the window, greets the user,
# and displays the current date and time.
#clear # Clear the window
echo “SCRIPT BEGINS”
echo “Hello $LOGNAME!” # Greet the user
echo
echo “Todays date and time: c”
date # Display current date and time
echo
mynum=21 # Set a local shell variable
myday=”Monday” # Set a local shell variable
echo “The value of mynum is $mynum”
echo “The value of myday is $myday”
echo
echo “SCRIPT FINISHED!!”
echo

 

—————-
bash-3.2$ ./scriptwithcomments.sh
SCRIPT BEGINS
Hello shell!

Todays date and time: Fri Apr 27 09:07:20 EDT 2018

The value of mynum is 21
The value of myday is Monday

SCRIPT FINISHED!!

From: http://sitestree.com/?p=12215
Categories:Linux/Unix: Shell Programming – 001
Tags:
Post Data:2018-04-30 23:10:32

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada