The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 01-05-2009
./hari.sh's Avatar
./hari.sh ./hari.sh is offline
Registered User
  
 

Join Date: Jul 2007
Location: India
Posts: 44
Count number of digits in a word

Hi all

Can anybody suggest me, how to get the count of digits in a word

I tried

Code:
WORD=abcd1234
echo $WORD | grep -oE [[:digit:]] | wc -l
4
It works in bash command line, but not in scripts