Re: rename vs rename -- was Re: Renaming files

2019-10-07 Thread Duncan Roe via luv-main
On Tue, Oct 08, 2019 at 09:45:49AM +1100, luv-main wrote:
>
> Dunno if slackware has it packaged, but the perl-based rename command is
> available from https://metacpan.org/release/File-Rename

Thanks but no thanks. Slackware rename is part of util-linux.
>
> On Ubuntu, "apt-get install rename".
>
Tried that, don't like it. For a beginner, the util-linux one is much simpler,
this from the man page:

> EXAMPLES
>Given the files foo1, ..., foo9, foo10, ..., foo278, the commands
>
>   rename foo foo0 foo?
>   rename foo foo0 foo??
>
>will turn them into foo001, ..., foo009, foo010, ..., foo278.  And
>
>   rename .htm .html *.htm
>
>will fix the extension of your html files.

No need to understand sed :)

Cheers ... Duncan.
___
luv-main mailing list
luv-main@luv.asn.au
https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main


Re: rename vs rename -- was Re: Renaming files

2019-10-07 Thread Craig Sanders via luv-main
On Tue, Oct 08, 2019 at 09:28:05AM +1100, Duncan Roe wrote:
> Under Slackware:
>
> > 09:03:07$ file $(type -p rename)
> > /usr/bin/rename: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), 
> > dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped

Dunno if slackware has it packaged, but the perl-based rename command is
available from https://metacpan.org/release/File-Rename

> Checked my Ubuntu VM (debian-based): no rename command.

On Ubuntu, "apt-get install rename".

Or, for very old versions of ubuntu (<= trusty 14.04):

apt-get install libfile-rename-perl


For details, see  
https://askubuntu.com/questions/956010/whats-the-difference-between-the-different-rename-commands

craig

--
craig sanders 
___
luv-main mailing list
luv-main@luv.asn.au
https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main


Re: rename vs rename -- was Re: Renaming files

2019-10-07 Thread Duncan Roe via luv-main
On Mon, Oct 07, 2019 at 09:48:37PM +1100, luv-main wrote:

> FWIW there is rename and there is rename ... on Debian (and Devuan in my
> case) at least, further information:
>
> TL/DR;
>
> NB: the Debian provided version of rename that comes with perl is a
> "deprecated program in use:" ... but there is a replacement version
> (perhaps exactly the same) from a standalone package.
>
>
> # aptitude show rename
> Package: rename
> Version: 0.20-4
> State: not installed
> Priority: optional
> Section: perl
> Maintainer: Debian Perl Group 
> Architecture: all
> Uncompressed Size: 36.9 k
> Depends: perl
> Conflicts: libfile-rename-perl
> Replaces: libfile-rename-perl
> Provides: libfile-rename-perl
> Description: Perl extension for renaming multiple files
>  This package provides both a perl interface for renaming files
> (File::Rename) and a command line tool 'rename' which is intended to
> replace the version currently supplied by the perl package.
> Homepage: https://metacpan.org/release/File-Rename
>
>
>
> $ rename 's/H/J/' 6H9A00*
> Deprecated program in use: rename as shipped with the Debian perl
> package will be removed after the release of stretch. Please install the
> separate 'rename' package which will provide the same command.
>
>
> $ which rename
> /usr/bin/rename
>
>
> $ file /usr/bin/rename
> /usr/bin/rename: symbolic link to /etc/alternatives/rename
>
>
> $ ls -lart /etc/alternatives/rename
> lrwxrwxrwx 1 root root 16 May 12 08:57 /etc/alternatives/rename ->
> /usr/bin/prename
>
>
> $ file /usr/bin/prename
> /usr/bin/prename: Perl script text executable
>
>
> # apt-get install rename
> Reading package lists... Done
> Building dependency tree  
> Reading state information... Done
> The following NEW packages will be installed:
>   rename
> 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
> Need to get 12.5 kB of archives.
> After this operation, 36.9 kB of additional disk space will be used.
> Get:1 http://ftp.au.debian.org/debian stretch/main amd64 rename all
> 0.20-4 [12.5 kB]
> Fetched 12.5 kB in 0s (65.0 kB/s)
> Selecting previously unselected package rename.
> (Reading database ... 283269 files and directories currently installed.)
> Preparing to unpack .../archives/rename_0.20-4_all.deb ...
> Unpacking rename (0.20-4) ...
> Setting up rename (0.20-4) ...
> update-alternatives: using /usr/bin/file-rename to provide
> /usr/bin/rename (rename) in auto mode
> Processing triggers for man-db (2.7.6.1-2) ...
>
>
>
> # which rename
> /usr/bin/rename
>
>
> # ls -lart /usr/bin/rename
> lrwxrwxrwx 1 root root 24 May 12 08:57 /usr/bin/rename ->
> /etc/alternatives/rename
>
>
> # ls -lart /etc/alternatives/rename
> lrwxrwxrwx 1 root root 20 Oct  7 21:01 /etc/alternatives/rename ->
> /usr/bin/file-rename
>
>
> # file /usr/bin/file-rename
> /usr/bin/file-rename: Perl script text executable
>
>

That's the problem with my proposed solution then (which was almost straight
from the man page):

Under Slackware:

> 09:03:07$ file $(type -p rename)
> /usr/bin/rename: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), 
> dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped

Checked my Ubuntu VM (debian-based): no rename command.

Cheers ... Duncan.
___
luv-main mailing list
luv-main@luv.asn.au
https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main


rename vs rename -- was Re: Renaming files

2019-10-07 Thread Andrew McGlashan via luv-main
FWIW there is rename and there is rename ... on Debian (and Devuan in my
case) at least, further information:

TL/DR;

NB: the Debian provided version of rename that comes with perl is a
"deprecated program in use:" ... but there is a replacement version
(perhaps exactly the same) from a standalone package.


# aptitude show rename
Package: rename 
Version: 0.20-4
State: not installed
Priority: optional
Section: perl
Maintainer: Debian Perl Group 
Architecture: all
Uncompressed Size: 36.9 k
Depends: perl
Conflicts: libfile-rename-perl
Replaces: libfile-rename-perl
Provides: libfile-rename-perl
Description: Perl extension for renaming multiple files
 This package provides both a perl interface for renaming files
(File::Rename) and a command line tool 'rename' which is intended to
replace the version currently supplied by the perl package.
Homepage: https://metacpan.org/release/File-Rename



$ rename 's/H/J/' 6H9A00*
Deprecated program in use: rename as shipped with the Debian perl
package will be removed after the release of stretch. Please install the
separate 'rename' package which will provide the same command.


$ which rename
/usr/bin/rename


$ file /usr/bin/rename
/usr/bin/rename: symbolic link to /etc/alternatives/rename


$ ls -lart /etc/alternatives/rename
lrwxrwxrwx 1 root root 16 May 12 08:57 /etc/alternatives/rename ->
/usr/bin/prename


$ file /usr/bin/prename
/usr/bin/prename: Perl script text executable


# apt-get install rename
Reading package lists... Done
Building dependency tree  
Reading state information... Done
The following NEW packages will be installed:
  rename
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.5 kB of archives.
After this operation, 36.9 kB of additional disk space will be used.
Get:1 http://ftp.au.debian.org/debian stretch/main amd64 rename all
0.20-4 [12.5 kB]
Fetched 12.5 kB in 0s (65.0 kB/s)
Selecting previously unselected package rename.
(Reading database ... 283269 files and directories currently installed.)
Preparing to unpack .../archives/rename_0.20-4_all.deb ...
Unpacking rename (0.20-4) ...
Setting up rename (0.20-4) ...
update-alternatives: using /usr/bin/file-rename to provide
/usr/bin/rename (rename) in auto mode
Processing triggers for man-db (2.7.6.1-2) ...



# which rename
/usr/bin/rename


# ls -lart /usr/bin/rename
lrwxrwxrwx 1 root root 24 May 12 08:57 /usr/bin/rename ->
/etc/alternatives/rename


# ls -lart /etc/alternatives/rename
lrwxrwxrwx 1 root root 20 Oct  7 21:01 /etc/alternatives/rename ->
/usr/bin/file-rename


# file /usr/bin/file-rename
/usr/bin/file-rename: Perl script text executable


___
luv-main mailing list
luv-main@luv.asn.au
https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main