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

Re: Bug#263757: a few comments about proposed readlink patch



On Wed, Dec 08, 2004 at 01:08:12PM +0100, Jeroen van Wolffelaar wrote:
> On Wed, Dec 08, 2004 at 12:16:49PM +0100, Francesco Paolo Lovergine wrote:
> > Basically the proposed patch needs one more hack:
> > If $dir is not a symlink, readlink returns nothing, so:
> > 
> >     link=`/bin/readlink -f "$dir"`
> >     if [ "x$link" != "x" ]; then
> >     	dir="$link"
> >     fi
> 
> Eh, it works fine. readlink returns nothing (and exits 1) if the link is
> invalid or the path doesn't exist. If the path is already canonical,
> it'll return it as-is.
> 
> By the way, you should probably drop the '/bin/' part, in Debian scripts
> one does not qualify commands in general.
> 

It's not clear to me why one would use /lib/init/readlink instead of
/bin/readlink. That was just to clarify that the coreutils program
should be used IMHO.

-- 
Francesco P. Lovergine



Reply to: