On 9/12/07, John H. Robinson, IV <[EMAIL PROTECTED]> wrote:
> Chuck Esterbrook wrote:
> >
> > "readlink" works from bash on both systems.
> >
> > I could upgrade the boxes, but this script is for external users and
> > "readlink" appears ubiquitous.
>
> Be careful of readlink:
>
> [EMAIL PROTECTED]:~]% ls -l /usr/bin/vi
> lrwxrwxrwx 1 root root 20 Sep 9 15:34 /usr/bin/vi -> /etc/alternatives/vi
> [EMAIL PROTECTED]:~]% ls -l /etc/alternatives/vi
> lrwxrwxrwx 1 root root 18 Sep 9 18:48 /etc/alternatives/vi ->
> /usr/bin/vim.basic
> [EMAIL PROTECTED]:~]% ls -l /usr/bin/vim.basic
> -rwxr-xr-x 1 root root 1384232 Aug 29 04:02 /usr/bin/vim.basic
>
> [EMAIL PROTECTED]:~]% readlink /usr/bin/vi
> /etc/alternatives/vi
> [EMAIL PROTECTED]:~]% readlink /etc/alternatives/vi
> /usr/bin/vim.basic
> [EMAIL PROTECTED]:~]% readlink /usr/bin/vim.basic
> zsh: exit 1 readlink /usr/bin/vim.basic
>
> I would have expected ``readlink /usr/bin/vi'' to report
> /usr/bin/vim.basic.
>From $ man readlink
- - - - -
DESCRIPTION
Display value of a symbolic link on standard output.
-f, --canonicalize
canonicalize by following every symlink in every component of
the given path recursively
- - - - -
> [EMAIL PROTECTED]:~]% realpath /usr/bin/vi
> /usr/bin/vim.basic
Has somebody made a realpath(1) for Debian which calls realpath(3) ?
carl
--
carl lowenstein marine physical lab u.c. san diego
[EMAIL PROTECTED]
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg