From owner-freebsd-questions Wed Feb 20 12:41:58 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mired.org (dsl-64-192-6-133.telocity.com [64.192.6.133]) by hub.freebsd.org (Postfix) with SMTP id D391E37B400 for ; Wed, 20 Feb 2002 12:41:54 -0800 (PST) Received: (qmail 18040 invoked by uid 100); 20 Feb 2002 20:41:52 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15476.2575.742300.102885@guru.mired.org> Date: Wed, 20 Feb 2002 14:41:51 -0600 To: Cliff Sarginson Cc: eric_boucher60@yahoo.com, questions@freebsd.org Subject: Re: Bourne shell programming problem In-Reply-To: <92450904@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: "Mike Meyer" X-Delivery-Agent: TMDA/0.46 (Python 2.2; freebsd-4.5-STABLE-i386) 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 Cliff Sarginson 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. 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