Hallo, Am Son, 24 Jun 2007, Matthias Müller schrieb:
Hallo Andy,
Am Samstag, 23. Juni 2007 schrieb Andreas Schott: snip
#!/bin/bash for bild in /home/www/web3/html/galerie/*.jpg; do ziel=`echo $bild | sed s/.jpg/.jpg/` convert $bild -geometry 150x150 thumbs/$ziel done
Jetzt meckert error_log
convert: unable to open image `thumbs//home/www/web3/html/galerie/1.jpg': No such file or directory [..] Ersetze mal die Anweisung "ziel=..." durch folgendes: ziel=$(basename ${bild}) [..]
Wird alles auch über Leer- und andere Sonderzeichen stolpern. Kinners, is das denn soo schwer Variablen einfach immer zu quoten? ==== #!/bin/bash cd /home/www/web3/html/galerie/ || exit $? for bild in *.jpg; do # ziel="${bild##*\/}" ### ist hier nicht nötig wg. "cd" # ziel="`basename \"$bild\"`" ### wenn's kein bashism sein soll ziel="$bild" convert -geometry 150x150 -resize 150x150 "$bild" "thumbs/$ziel" done ==== HTH, HAND, -dnh -- "Waaah! No! Florence will eat the poor little rats and they'll never grow up to be lawyers!" "Helix, rats don't grow up to be lawyers." "All the more reason they should live then, isn't it?" -- "Freefall" -- Um die Liste abzubestellen, schicken Sie eine Mail an: opensuse-de+unsubscribe@opensuse.org Um eine Liste aller verfuegbaren Kommandos zu bekommen, schicken Sie eine Mail an: opensuse-de+help@opensuse.org