The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM



Thread: awk help
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-07-2008
mohan705 mohan705 is offline
Registered User
 

Join Date: Feb 2007
Posts: 91
awk help

Hi

Using awk,want to remove file extension.Below command giving error



echo 'a1.txt' |awk '{print substr($0,1,index($0,'.')-1}'

o/p suould be

a1

Thanks in advance
MR
Reply With Quote
Forum Sponsor