Date: 11 Jul 2005 15:34:01 -0400 From: Lowell Gilbert <freebsd-questions-local@be-well.ilk.org> To: freebsd-questions@freebsd.org Subject: Re: OT: Shell script Message-ID: <44d5ppp26u.fsf@be-well.ilk.org> In-Reply-To: <20050711121921.O85191@wolf.pjkh.com> References: <1f75ab0e050711113657ba7057@mail.gmail.com> <44irzhp3fj.fsf@be-well.ilk.org> <20050711121921.O85191@wolf.pjkh.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Philip Hallstrom <freebsd@philip.pjkh.com> writes: > >> 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'. > > > > basename(1); it's even POSIX, so it's pretty portable. > > But only if he knows the file extension before hand... Hmm. Good point. Looking into my existing scripts, I seem to use ${fil%.*}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44d5ppp26u.fsf>