The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Stripping out extension in file name
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Directory
Register
Forum Rules
FAQ
Contribute
Members List
Search
Today's Posts
Mark Forums Read
Thread
:
Stripping out extension in file name
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
5
(
permalink
)
02-25-2007
ahmedwaseem2000
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
..
ahmedwaseem2000
View Public Profile
Find all posts by ahmedwaseem2000