Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

Shell script to display time in word

Posted By: Luete Fischer     Category: Unix / Linux / Ubuntu     Views: 8672

Write a shell script to display time in word.

Code for Shell script to display time in word in Unix / Linux / Ubuntu

clear
echo "Current Time is: " `date +%r`
h=`date +%H`
m=`date +%M`
s=`date +%S`
echo "Hour is "$h
echo "Minute is "$m
echo "Seconds are "$s
    case $h in
        1)echo "ONE ";;
        2)echo "TWO ";;
        3)echo "THREE ";;
        4)echo "FOUR ";;
        5)echo "FIVE ";;
        6)echo "SIX ";;
        7)echo "SEVEN ";;
        8)echo "EIGHT ";;
        9)echo "NINE ";;
        10)echo "TEN ";;
        11)echo "ELEVEN ";;
        12)echo "TWELVE ";;
        *)echo "Invalid ";;
    esac
  
Share: 


Didn't find what you were looking for? Find more on Shell script to display time in word Or get search suggestion and latest updates.

Luete Fischer
Luete Fischer author of Shell script to display time in word is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 

Other Interesting Articles in Unix / Linux / Ubuntu:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!