The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Extract numbers below words with awk cgkmal Shell Programming and Scripting 17 01-15-2009 05:48 AM
print only last two words of a line pradeepreddy Shell Programming and Scripting 5 08-22-2008 02:23 AM
Query to print numbers in words vanitham Web Programming, Web 2.0 and Mashups 5 08-18-2008 10:52 AM
How do I print(save) words to postscript? luked High Level Programming 0 07-02-2008 10:56 PM
how to separate numbers and words from a file using shell scripts kamakshi s UNIX for Dummies Questions & Answers 1 06-26-2008 10:02 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-19-2009
bab123 bab123 is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 14
Red face Query to print numbers in words

Hi,

I have to write a shell script that converts numbers in to words
below is what i wrote.My script is not running.


-----------------------------------
echo -n "Enter number : "
read n
len= echo $n | wc -c
echo " number in words : "
for ( i=1; i<len; i++ )

do
num=echo $n | cut -c i

case num in
0) echo -n "zero " ;;
1) echo -n "one " ;;
2) echo -n "two " ;;
3) echo -n "three " ;;
4) echo -n "four " ;;
5) echo -n "five " ;;
6) echo -n "six " ;;
7) echo -n "seven " ;;
8) echo -n "eight " ;;
9) echo -n "nine " ;;
esac
done
---------------------------

Some one please correct me

Thanks in Advance
bab123
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0