On Sat, Nov 12, 2011 at 2:41 PM, Bjartur Thorlacius <svartma...@gmail.com> wrote: > On Sat, 12 Nov 2011 20:20:57 -0000, Peng Yu <pengyu...@gmail.com> wrote: >> >> Should this be added to an existing coreutils' command or add a new >> command to coreutils? Personally I'd prefer to add a command called >> relpath. But I'm not sure the standard organization in coreutils. >> > There is already an utility called realpath in Debian that does what you > want given -s as an argument. There's also a realpath(3) wrapper in FreeBSD,
I don't see how realpath can do what I want. relpath.py gives me the relative path of a from b. But realpath doesn't do so. /tmp$ mkdir a b /tmp$ relpath.py a b ../a /tmp$ realpath -s a b /tmp/a /tmp/b Also, from the manpage "realpath converts each filename argument to an absolute pathname, ". Would you please show me how to use realpath to compute the relative path? > but it does not accept -s. It's effectively a synonym with GNU coreutil's > readlink -f. > I think coreutils should include Debian's realpath or a compatible > replacement. Should we approach FreeBSD wrt to -s? > -- Regards, Peng