[Top][All Lists]

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

bug in mv (fileutils) 4.1

From: Hans Ginzel
Subject: bug in mv (fileutils) 4.1
Date: Tue, 22 Oct 2002 21:45:14 +0200
User-agent: Mutt/1.3.28i


   There is in the fileutils.info:

Trailing slashes

   Some GNU programs (at least `cp' and `mv') allow you to remove any
trailing slashes from each SOURCE argument before operating on it.  The
`--strip-trailing-slashes' option enables this behavior.

   This is useful when a SOURCE argument may have a trailing slash and
specify a symbolic link to a directory.  This scenario is in fact rather
common because some shells can automatically append a trailing slash
when performing file name completion on such symbolic links.  Without
this option, `mv', for example, (via the system's rename function) must
interpret a trailing slash as a request to dereference the symbolic link
and so must rename the indirectly referenced _directory_ and not the
symbolic link.  Although it may seem surprising that such behavior be
the default, it is required by POSIX.2 and is consistent with other
parts of that standard.

   I have tried this:

        export POSIXLY_CORRECT=1
        mkdir mv_test
        cd mv_test
        mkdir a c
        ln -s a b
        mv -v b/ c
        alias mv
        which mv

I expected, as is written, that the directory a will be moved into
directory c (the symbolic link b to directory a will be dereferenced),
but the link b has been moved. There is no alias for mv, mv resides in

        Best regards
                                                Hans Ginzel

Using Debian GNU/Linux Woody 3.0.

reply via email to

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