cut file extension
owen.townend at gmail.com
Wed Feb 20 12:40:57 UTC 2008
On 2/20/08, Owen Townend <owen.townend at gmail.com> wrote:
> On 2/20/08, Germain Morbe <germain.morbe at web.de> wrote:
> > Hi all,
> > im looking for a solution to strip the file extension
> > within a bash script.
> > thanks
> > --
> > ubuntu-users mailing list
> > ubuntu-users at lists.ubuntu.com
> > Modify settings or unsubscribe at:
> > https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
> Look into `sed`. Something like this should do it
> `sed -e 's/.*$//'`
> That's from the top of my head though, check it first!
just realised that wipes the whole line...
Try `sed -e 's/.mp3$//'` for a single extension.
`sed -e 's/.mp3$/.wma/'` to change it.
`sed -e 's/....$//'` to cut a three letter extension and the '.'
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ubuntu-users