command and script question

3 posts / 0 new
Last post
ninjanoir78's picture
command and script question



I see many scipts with that : #,  I would like to know if we need to put it in the script or if it is only for explanation?



 #Check if date is at least 2016 to validade VPN certificates

YEAR=`date "+%Y"`

while [ $YEAR -le 2016 ]; do
   /bin/echo "We do not have a valid date.\n" >> $LOGFILE
   /etc/init.d/ntpclient stop
   /usr/sbin/ntpclient -s -h
   /bin/sleep 2
   /etc/init.d/ntpclient start
   NOW=$(date +"%H:%M, %d-%m-%Y")
   YEAR=`date "+%Y"`

kamoj's picture
You don't have to put "# and

You don't have to put "# and text to end of line" in the scripts - unless it is within quotes such as"#" or '#'...

pb1983's picture
# means the line is a comment

# means the line is a comment, usually to explaine the following code