Concern about --reply=no option of mv.

2008-01-07 Thread Dana Runge
Folks,

I noticed that the --reply option is being deprecated in mv.

Perhaps I am overlooking something, but it appears as if key
functionality is being removed from the command.

I regularly write scripts with --reply=no with the intent that if the
target file exists, the mv command fails. Neither of the recommended
replacements, -i, nor -f offer this functionality. Because these scripts
may be run from a cron job, I don't want to ask for user input.

The only option left, if --reply=no is removed, is to use

mv -i x y  /dev/null 2 /dev/null

You tell me, is this clearer than

mv --reply=no x y

I don't think so.

If you insist on removing my beloved --reply=no, please replace it with
a new option that provides the same functionality, and please provide
several years, 3-4 at least, to allow the new command to propagate
through all the various Linux distributions that are out there.

Thanks,
Yours,
Dana


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: Concern about --reply=no option of mv.

2008-01-07 Thread Philip Rowlands

On Mon, 7 Jan 2008, Dana Runge wrote:


I noticed that the --reply option is being deprecated in mv.

Perhaps I am overlooking something, but it appears as if key 
functionality is being removed from the command.


I regularly write scripts with --reply=no with the intent that if the 
target file exists, the mv command fails. Neither of the recommended 
replacements, -i, nor -f offer this functionality. Because these 
scripts may be run from a cron job, I don't want to ask for user 
input.


The only option left, if --reply=no is removed, is to use

   mv -i x y  /dev/null 2 /dev/null

You tell me, is this clearer than

   mv --reply=no x y

I don't think so.


I think the problem was that mv would prompt in other circumstances than 
the example above, and that the option was being misunderstood. This 
thread has the discussion:


http://lists.gnu.org/archive/html/bug-coreutils/2005-06/msg00160.html

If you insist on removing my beloved --reply=no, please replace it 
with a new option that provides the same functionality, and please 
provide several years, 3-4 at least, to allow the new command to 
propagate through all the various Linux distributions that are out 
there.


Will your cron-driven script have a terminal on stdin? The help text for 
--reply used to say at one point:


  --reply={yes,no,query}   specify how to handle the prompt about an
   existing destination file.  Note that
   --reply=no has an effect only when mv
   would prompt without -i or equivalent, i.e.,
   when a destination file exists and is not
   writable, standard input is a terminal, and
   no -f (or equivalent) option is specified

Other alternatives and examples are given in the abovementioned thread.


Cheers,
Phil


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils