in reply to Absolute pathnames from relative?
s/\/[^\/]*\/\.\.\//\//g
Just set this baby on your concatenated paths, and your '..' will magically disappear. You could use
to strip your single dots as well...s/\/\.\//\/g
This will just give you the path it 'should' be, if there are no weird filesystem thingies going on.
(yes, I could've used s### or something, but this is more fun.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Absolute pathnames from relative?
by graff (Chancellor) on Oct 15, 2005 at 16:34 UTC | |
|
Re^2: Absolute pathnames from relative?
by argv (Pilgrim) on Nov 20, 2004 at 03:36 UTC |