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 -->
  #1 (permalink)  
Old 07-16-2008
netbanker netbanker is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 8
how to get number char from a string

for example:

i hav a string like :

/rmsprd/arch01/rmsprd/rmsprdarch72736.log

how I can extract

my_num=72736?

I know I can

echo "/rmsprd/arch01/rmsprd/rmsprdarch72736.log" | tr "/" " " | awk '{ print $4 }' to get rmsprdarch72736.log