Hello, on Donnerstag, 15. Juli 2010, Tim Mohlmann wrote:
Cristian,
Script to download several images (not really tested, but should work):
grep ".." imglist.txt | while read file ; do img=$(echo $file | sed 's/^Image://') imgpath=$(echo "$img" | md5sum - | sed 's§^\(.\)\(.\).*§\1/\1\2§') wget "http://old-en.opensuse.org/images/$imgpath/$img" done
With a lot of pain and sorrow I finaly got the sed command to work. the § character was real pain in the ass, since putty did strange things with it. After a lot of research a figured out you used § as an alternative escape character. I replaced it with @ and it worked!!!
Yes, exactly. You can use any special character as separator, like !§$%& - or something like ¿ or ¡ if you want to be quite sure that it isn't contained in the text.
Now the other thing... my md5sum output is different than it is in the wiki structure. I have output: http://old-en.opensuse.org/images/f/fc/Ltsp-firewall1.png while this file is stored under http://old-en.opensuse.org/images/e/e5/Ltsp-firewall1.png
Just without the script the md5sum is: echo Ltsp-firewall1.png | md5sum fc0ffae0dc420b931ad46ea1eaa05d10 -
So finally the script is okay, but now the md5sum appears to be different. Tried all sorts of different combo's. With or without File: with or without suffix .png. Tried different kind of capitalization. Nothing seems to give the correct md5sum. Sure it is md5sum?
It is md5sum, but my script has a little bug ;-) (you have probably seen the "untested" label...) You need to use echo -n instead of only echo to avoid the newline (which breaks the md5sum). Regards, Christian Boltz -- In the beginning was the word, and the word was content-type: text/plain -- To unsubscribe, e-mail: opensuse-wiki+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-wiki+help@opensuse.org