Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/bin/bash
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
hellraiser
Guru
Guru


Joined: 14 Jun 2003
Posts: 431
Location: Pescara [Italy]

PostPosted: Thu Jul 17, 2003 11:56 am    Post subject: /bin/bash Reply with quote

sentite...ho un urgente necessita di rinominare dei file jpg in ordine progressivo...tutti con lo stesso nome, pero con un numero progressivo

ex. photo_001.jpg
photo_002.jpg
photo_003.jpg
photo_004.jpg
ecc.

mi servirebbe un piccolo script bash...per poter far questo ed evitare che lo faccia io a mano sono piu di 1000 foto...

perfavore AIUTOOOOOO

thanks :evil:
_________________
Io non sono nessuno...ma nessuno è come me!

"Open Source is a good idea..."
Back to top
View user's profile Send private message
hellraiser
Guru
Guru


Joined: 14 Jun 2003
Posts: 431
Location: Pescara [Italy]

PostPosted: Thu Jul 17, 2003 12:16 pm    Post subject: Reply with quote

risolto con il perl :)

#!/usr/bin/perl

$my_dir = @ARGV[0] || die "Non è stata specificata la directory\n";
@files = `ls $my_dir`;
chop @files;

foreach $f(@files) {
$count++;
$f =~ /\.(.*)/;
rename("$my_dir/$f", "$my_dir/$count.$1");
}

addios :twisted:
_________________
Io non sono nessuno...ma nessuno è come me!

"Open Source is a good idea..."
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum