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 -->
  #2 (permalink)  
Old 07-16-2008
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
  
 

Join Date: Dec 2007
Location: Home of 17-time world champion Boston Celtics
Posts: 1,311
Cool will it always be in same format?

Code:
> echo "/rmsprd/arch01/rmsprd/rmsprdarch72736.log" | cut -d"/" -f5 | cut -d"." -f1
rmsprdarch72736
if you know it will always be ten characters (rmsprdarch), then
Code:
> echo "/rmsprd/arch01/rmsprd/rmsprdarch72736.log" | cut -d"/" -f5 | cut -d"." -f1 | cut -c11-
72736