From owner-freebsd-questions@FreeBSD.ORG Mon Jul 11 19:20:08 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EA7916A41C for ; Mon, 11 Jul 2005 19:20:08 +0000 (GMT) (envelope-from freebsd@philip.pjkh.com) Received: from zhonka1.zhonka.net (zhonka1.zhonka.net [66.228.195.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 16CD743D58 for ; Mon, 11 Jul 2005 19:20:03 +0000 (GMT) (envelope-from freebsd@philip.pjkh.com) Received: from wolf.pjkh.com ([66.228.196.74]) by zhonka1.zhonka.net (Post.Office MTA v3.5.3 release 223 ID# 0-58414U4500L450S0V35) with ESMTP id net; Mon, 11 Jul 2005 12:20:03 -0700 Received: from localhost (localhost [127.0.0.1]) by wolf.pjkh.com (Postfix) with ESMTP id 9E85758CA; Mon, 11 Jul 2005 12:19:57 -0700 (PDT) Received: from wolf.pjkh.com ([127.0.0.1]) by localhost (wolf.pjkh.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 84981-04; Mon, 11 Jul 2005 12:19:57 -0700 (PDT) Received: by wolf.pjkh.com (Postfix, from userid 1000) id 6A36D58C9; Mon, 11 Jul 2005 12:19:57 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by wolf.pjkh.com (Postfix) with ESMTP id 6352258C8; Mon, 11 Jul 2005 12:19:57 -0700 (PDT) Date: Mon, 11 Jul 2005 12:19:57 -0700 (PDT) From: Philip Hallstrom To: Lowell Gilbert In-Reply-To: <44irzhp3fj.fsf@be-well.ilk.org> Message-ID: <20050711121921.O85191@wolf.pjkh.com> References: <1f75ab0e050711113657ba7057@mail.gmail.com> <44irzhp3fj.fsf@be-well.ilk.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at pjkh.com Cc: Brian Henning , freebsd-questions@freebsd.org Subject: Re: OT: Shell script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2005 19:20:08 -0000 >> 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...