Il Mon, 13 Sep 2004 20:40:07 +0200, Gianni Olivieri - ha scritto: > Il giorno Monday 13 September 2004, alle 20:14, Mattia scrisse: > | Suggerimenti? Link? Imprecazioni? > > questo e' UN esempio fatto senza awk pero'... ci sono _sicuramente_ modi > molto piu' eleganti per farlo, ma puo' darti cmq qualche spunto... > > ========================================================================= > > #!/bin/bash > > files="test_files.txt" > > > (IFS=' > '; > for riga in `cat $files`; > do > > link=`echo $riga | cut -f1 -d " "` > name=`echo $riga | cut -f2 -d " "` > size=`echo $riga | cut -f3 -d " "` > md5sum=`echo $riga | cut -f4 -d " "` > > echo "link: $link" > echo "name: $name" > echo "size: $size" > echo "md5: $md5sum" > > done > ) > > ========================================================================== > > | > | > | -- > | To UNSUBSCRIBE, email to [EMAIL PROTECTED] > | with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] > > -- > Gianni Olivieri | Debian/GNU Linux On Kernel 2.6.5 > [EMAIL PROTECTED] | Linux registered user #333000 > [EMAIL PROTECTED] | <Jabber Id> [EMAIL PROTECTED] > > (8) It is more complicated than you think. > <RFC 1925 - Fundamental Truths of Networking>
Ciao, dovrei rinominare una serie di foto utilizzando i dati contenuti nel file di testo come hai spiegato tu. Esempio : #!/bin/bash contatore=1000 est=jpg data=`date` dir=/tmp/foto files="dati.txt" rm /tmp/foto/ -R mkdir /tmp/foto/ (IFS=' '; for riga in `cat $files`; do nome=`echo $riga | cut -f1 -d " "` dimensione=`echo $riga | cut -f2 -d " "` descrizione=`echo $riga | cut -f3 -d " "` prezzo=`echo $riga | cut -f4 -d " "` echo "nome: $nome" echo "dimensione: $dimensione" echo "descrizione: $descrizione" done ) for i in * do contatore=$[1+$contatore] cp "$i" "IMG_$contatore" convert -border 90x90 -bordercolor white -gravity SouthEast -font Helvetica -pointsize 80 -fill '#ff0000' -draw 'text 10,100 "%f | %[EXIF:DateTime]"' -quality 75 "IMG_$contatore" "$dir/IMG_$contatore.$est" done Puoi aiutarmi? Grazie.

