bug-fileutils
[Top][All Lists]
Advanced

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

mv exit status: `echo n |mv -i a b'


From: Jim Meyering
Subject: mv exit status: `echo n |mv -i a b'
Date: Sun, 05 Aug 2001 12:34:09 +0200
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.105

With fileutils-4.1, mv -i exits nonzero if any response to a prompt
is negative.  I want to change it to be more in line with my reading
of POSIX (and coincidentally with the behavior of several vendor-supplied
versions of mv :-).  That will also make it consistent with the way
cp's -i option works.

With fileutils-4.1:

  $ touch a b;echo n|/bin/mv -i a b; echo $?; echo
  /bin/mv: overwrite `b', overriding mode 0444? 1

With the proposed change:

  $ touch a b;echo n|./mv -i a b; echo $?; echo
  ./mv: overwrite `b', overriding mode 0444? 0

Does anyone know of a reason not to do make that change?

-----------------
This is the ambiguous part of the POSIX spec:

  EXIT STATUS
    The following exit values shall be returned:
      0 All input files were moved successfully.
      >0 An error occurred.

The exit status seems to be over-specified, because with -i and a
negative response, there is neither an error, nor have all files been moved.

Here's the description of -i:

  -i             Prompt for confirmation if the destination path exists.
                Any previous occurrences of the -f option is ignored.


Jim



reply via email to

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