bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Normalizing pathnames


From: Jim Meyering
Subject: Re: Normalizing pathnames
Date: Thu, 07 Oct 2004 13:34:18 +0200

address@hidden wrote:
> That got me thinking. If the path doesn't exist then
> I think readlink -f should just return the canonicalized
> path (the output from realpath). That would be more useful
> that just stopping at the first invalid path component?
>
> I.E. I think the output from the following should be
> /usr/1/2/3 rather than /user/1
>
> readlink -f /usr/share/../1/2/3

Does readlink --canonicalize-missing do what you want?

  -m, --canonicalize-missing    canonicalize by following every symlink in
                                every component of the given path recursively,
                                without requirements on components existence

This is using CVS coreutils:

  $ ./readlink -m /usr/share/../1/2/3
  /usr/1/2/3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]