Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2002 14:41:51 -0600
From:      "Mike Meyer" <mwm-dated-1014669712.b2b28f@mired.org>
To:        Cliff Sarginson <csfbsd@raggedclown.net>
Cc:        eric_boucher60@yahoo.com, questions@freebsd.org
Subject:   Re: Bourne shell programming problem
Message-ID:  <15476.2575.742300.102885@guru.mired.org>
In-Reply-To: <92450904@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Cliff Sarginson <csfbsd@raggedclown.net> types:
> 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 :)

Nope, someone did it in perl. To provide equal time, here's yet
another one:

guru% FOO="/foo/tata/foo"
guru% python -c "print '/' + '$FOO'.split('/')[-1]"
/foo

Though I agree with Cliff, and would use basename for it.

	<mike

--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

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?15476.2575.742300.102885>