Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ames!dftsrv!mimsy!mojo!ziegast From: ziegast@eng.umd.edu (Eric W. Ziegast) Newsgroups: comp.lang.perl Subject: Re: path truncation quest Keywords: path,truncation Message-ID: <1991Mar22.055919.11363@eng.umd.edu> Date: 22 Mar 91 05:59:19 GMT References: <1991Mar21.010547.13331@convex.com> <1991Mar21.064642.29427@eng.umd.edu> <126224@uunet.UU.NET> Sender: news@eng.umd.edu (C-News) Organization: University of Merryland, Engineering Computing Services Lines: 18 In article <126224@uunet.UU.NET> rbj@uunet.UU.NET (Root Boy Jim) writes: >>A simplified version would be: >> /((\/F)+)+)\/(F)/ > >Too complex. First, pick another delimiter, and get rid of the \/'s. >Second, there is no sense saving the last pattern. Third, and >most importantly, you are going overboard. Restated, the goal is >"keep everything up to but not including the last slash". . . . etc . . . >> $1 will match the directory path. (man dirname) >> $2 is used only for /F grouping >> $3 will match the base name. (man basename) > >Aha! It seems that you have adapted a general routine. Call it "feeping creaturism". ;-) Eric Z