coreutils
[Top][All Lists]
Advanced

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

Re: rename command


From: Pádraig Brady
Subject: Re: rename command
Date: Mon, 27 Jun 2011 17:26:48 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 27/06/11 10:11, Sami Kerola wrote:
> Hello coreutilitarians,
> 
> I have been lately making some util-linux patches and while doing
> so I found rename command. It did not take long to realize that
> the command would be much better if it would support similar
> switches as mv. To accomplish that reusing gnulib copy
> functionality felt correct to me, but that is a problem within
> context of util-linux package, it does not use gnulib and I do
> not think it will have anytime soon. I proposed to move rename in
> util-linux mail list from util-linux to coreutils package, and
> Karel Zak, current util-linux maintainer, responded 'go ahead and
> ask at coreutils mailing list'.
> 
> So here we are, would it sound reasonable to take rename command
> to be part of coreutils?

Well it's not linux specific.
So I suppose it fits more here, than in util-linux.

I've never used rename actually, instead using find | sed | sh
in the rare times I've had to do something like this.
I find that easier and more general, for lower casing etc.
That is a process per file though.

Anyway, I see you're adding these options,
to better handle existing files.

+      fputs (_("\
+      --backup[=CONTROL]  make a backup of each existing destination file\
+\n\
+  -b                      like --backup but does not accept an argument\n\
+  -f, --force             do not prompt before overwriting\n\
+  -i, --interactive       prompt before overwrite\n\
+  -n, --no-clobber        do not overwrite an existing file\n\
+If you specify more than one of -i, -f, -n, only the final one takes effect.\n\
+  -S, --suffix=SUFFIX     override the usual backup suffix\n\
+  -v, --verbose           explain what is being done\n\

> To be a bit more concrete I wrote first version of patch. While
> the patch is nearly good there are issues. For instance
> tests/misc/help-version is failing, and I my attempt to fix that
> was unsuccessful. The command itself poses few implementation
> questions. Should rename support recursion

maybe.

> and should the rename
> move files across directories (IMHO that would be unintuitive)?

maybe not.

--- a/AUTHORS
+++ b/AUTHORS
@@ -62,6 +62,7 @@ printf: David MacKenzie
 ptx: François Pinard
 pwd: Jim Meyering
 readlink: Dmitry V. Levin
+rename: aeb(?), Sami Kerola

Andries Brouwer


+* rename invocation::            Rename multiple files by using pattern

s/by using pattern/using a pattern/ (in NEWS and info)

sorry I've not time to review fully,

cheers,
Pádraig.



reply via email to

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