On Wednesday 17 September 2008 17:18:47 Salvator*eL*arosa wrote:
> > $ find . -iname \*.txt -exec mv {} {}.jpeg \;
>
> Grazie per la celerità ma noto che quel comando aggiunge .jpeg
> all'intero file comprensivo di estensione .txt.
> A me in realtà servirebbe per esmpio che da file.txt passi a file.jpg.txt!
Ooops... ho letto troppo in fretta...
la modifica ovvia sarebbe
$ find . -iname \*.txt -exec mv {} $(basename {} .txt).jpeg.txt \;
ma pare che non funzioni, perché la shell interpreta $(basename ...) prima che
{} venga sostituito con il nome del file...
prendendo spunto dall'altra mail puoi usare rename:
$ find . -iname \*.txt -exec rename 's/\.txt$/.jpeg.txt/' {} \;
facci sapere su funziona
Flavio
--
Per REVOCARE l'iscrizione alla lista, inviare un email a
[EMAIL PROTECTED] con oggetto "unsubscribe". Per
problemi inviare un email in INGLESE a [EMAIL PROTECTED]
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]