The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Count number of digits in a word
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Count number of digits in a word
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
01-05-2009
tsurko
Registered User
Join Date: Jun 2007
Location: Sofia, Bulgaria
Posts: 35
Could you show us how you use this code in your script? If you want to save it in a variable try something like this:
Code:
COUNT=`echo $WORD | grep -oE [[:digit:]] | wc -l`
tsurko
View Public Profile
Find all posts by tsurko
Find tsurko's past nominations received
Find tsurko's present nominations given