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 -->
  #6 (permalink)  
Old 02-25-2007
sb008 sb008 is offline
Registered User
 

Join Date: Jan 2007
Posts: 366
Quote:
Originally Posted by ahmedwaseem2000
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"
echo "filename.tar" | sed "s/\..*$//"
Reply With Quote