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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 02-25-2007
ahmedwaseem2000 ahmedwaseem2000 is offline
Registered User
 

Join Date: Aug 2005
Location: Bangalore
Posts: 206
You could use either the awk or the cut solutions they will work in all the scenarios. Here is the sed solution to generalize on both the occasions.

Code:
 echo "filename.tar" | sed "s/\([^.*]\)\.\(.*\)*$/\1/g"

Last edited by ahmedwaseem2000; 02-25-2007 at 09:09 AM..
Reply With Quote