[Top][All Lists]

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

Re: rename command

From: Sami Kerola
Subject: Re: rename command
Date: Mon, 27 Jun 2011 20:31:26 +0200

2011/6/27 Pádraig Brady <address@hidden>:
> 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.

That is true as well.

> 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.

To be honest if the command would not already exist it should not be
taken to any package. Now when it already is in use making it good is
the reasonable thing to do.

> 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

Needs also to be inserted as proper_neme to #define AUTHORS.

> +* 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,


   Sami Kerola

reply via email to

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