[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rename command
From: |
Erik Auerswald |
Subject: |
Re: rename command |
Date: |
Tue, 28 Jun 2011 11:48:10 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hi,
On Tue, Jun 28, 2011 at 09:57:02AM +0100, Pádraig Brady wrote:
> On 28/06/11 08:21, Erik Auerswald wrote:
> > On Mon, Jun 27, 2011 at 05:26:48PM +0100, Pádraig Brady wrote:
> >> On 27/06/11 10:11, Sami Kerola wrote:
> >>>
> >>> I have been lately making some util-linux patches and while doing
> >>> so I found rename command.
> >>> [...]
> >>
> >> 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.
> >
> > FWIW, I usually use the rename perl script as distributed by Debian with
> > the perl package (because it is available, convenient and works well).
>
> Good point.
>
> # dpkg -S $(readlink -f $(which rename))
> perl: /usr/bin/prename
>
> That one supports -f for "force" too,
> but -n means "test" rather than "noclobber".
>
> Of course the replacement syntax is different
> and is more like my find | sed | sh pattern above,
> except it's not a process per file.
> So I'd prefer this one TBH.
>
> So portable scripts should use `prename` I guess
> for the perl syntax, and `rename` for the util-linux one.
I don't think this is really portable, the 'p' prefix was added to fix
Debian bug #304705. In fact I don't know if, where and under which name
this rename Perl script can be found in other distris or even the BSDs.
Regards,
Erik
--
Full disclosure is the only thing that forces vendors to fix security problems.
-- Bruce Schneier