Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

shows current time (12hrs), date, month by instance

set `date`
echo
echo '========================='
echo
echo "Today is: $1"
if [ $3 -eq 1 ]; then
        echo "Date is: $3st"
elif [ $3 -eq 2 ]; then
        echo "Date is: $3nd"
elif [ $3 -eq 3 ]; then
        echo "Date is: $3rd"
else
        echo "Date is: $3th"
fi
echo "Time is: `date "+%r"`"
echo
echo '========================='
echo
echo "Month is of: $2"
echo "Year is: $6"
echo "Timezone is: $5"
echo
echo '========================='
echo
set -x
 
PREVIOUS NEXT
Tagged: #shows #current #time #month #instance
ADD COMMENT
Topic
Name
8+8 =