Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2002 17:44:39 +0100
From:      F.Xavier Noria <fxn@isoco.com>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 20 Feb 2002 17:36:19 +0100
Cliff Sarginson <csfbsd@raggedclown.net> 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




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