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 05-27-2009
panyam panyam is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2008
Posts: 474
Did u try to test it ?..

Code:
VAR=`echo $LINE |awk -F. '{print $2}`
instead of $3.

other way :

To get extn

Code:
TEST>echo "Account_52320090605076_log.Z" |sed 's/.*\.\(.*\)/\1/'
Z
To get file name with out extn
Code:
 
TEST>echo "Account_52320090605076_log.Z" |sed 's/\(.*\)\..*/\1/'
Account_52320090605076_log

Last edited by panyam; 05-27-2009 at 09:43 AM..