Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jul 2005 11:57:59 -0700 (PDT)
From:      Philip Hallstrom <freebsd@philip.pjkh.com>
To:        Brian Henning <brian.henning@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: OT: Shell script
Message-ID:  <20050711115717.L84606@wolf.pjkh.com>
In-Reply-To: <1f75ab0e050711113657ba7057@mail.gmail.com>
References:  <1f75ab0e050711113657ba7057@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> All,
>
> I am trying to write an SH script that i need some functionality.
>
> I want it to be able to get a filename without the extention on the end.
>
> for example.
>
> file.mp3
>
> i would like it to return 'file'.

Probably lots of ways.

Use sed in a pipe...

sed 's/\....$//'

-philip



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050711115717.L84606>