From owner-freebsd-questions Wed Feb 20 8:44:59 2002 Delivered-To: freebsd-questions@freebsd.org Received: from smtp.bcn.isoco.net (ldap.isoco.net [212.9.90.11]) by hub.freebsd.org (Postfix) with ESMTP id EDAC337B405 for ; Wed, 20 Feb 2002 08:44:51 -0800 (PST) Received: from fxn.bcn.isoco.net (fxn.bcn.isoco.net [172.16.1.50]) by smtp.bcn.isoco.net (Postfix) with SMTP id C359ECD2B6 for ; Wed, 20 Feb 2002 17:44:49 +0100 (CET) Date: Wed, 20 Feb 2002 17:44:39 +0100 From: F.Xavier Noria To: freebsd-questions@FreeBSD.org Subject: Re: Bourne shell programming problem Message-Id: <20020220174439.436915d2.fxn@isoco.com> In-Reply-To: <20020220163619.GA3600@raggedclown.net> References: <20020220060104.49523.qmail@web9407.mail.yahoo.com> <20020219234405.V48401@blossom.cjclark.org> <20020220163619.GA3600@raggedclown.net> X-Mailer: Sylpheed version 0.7.1 (GTK+ 1.2.10; i386--freebsd4.4) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 20 Feb 2002 17:36:19 +0100 Cliff Sarginson wrote: : Here is another: : : echo "/toto/tata/foo" | sed "s;/.*/;/;" : : Personally I would do it using "basename" in this case, but : previous answers show you that method. Amazingly no-one has : suggested how to do it in "perl" yet .. it must be a perl-freak : holy day :) OK, one more, echo "/foo/tata/foo" | perl -pe 's,.*(?=/),,' :-) -- fxn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message