The UNIX and Linux Forums  

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 -->
  #6 (permalink)  
Old 06-26-2008
ynir ynir is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 35
another way to do this

Code:
# cat aaa
aabbccddDDCCDDCCaabbcc 123
CCaaCCBBCCaaaaaaaCCCaa 234
CCDDCCAACCCCccccccccaa 999

# for i in `cut -f1 aaa -d ' '`; do echo -n "$i "; echo -n $i | sed 's/[^a-z]//g' | wc -c; done
aabbccddDDCCDDCCaabbcc 14
CCaaCCBBCCaaaaaaaCCCaa 11
CCDDCCAACCCCccccccccaa 10