On 4/26/2011 at 06:12 PM, Peter Nikolic <p.nikolic1@btinternet.com> wrote:
Right the this is a fun one involving web pages
i use a page of basically the following line <a class="thumbnail" href="#thumb"><img src="stagepics/car4-0.jpg" width="100px"
height="75px" border="0" /><span><img src="stagepics/car4-0.jpg" /><br /></span></a>
to display a gallery of images from one of our recent rallys but i have somethingh like another 300 photos yet to go on lots of typing can someone point me in the direction of scripting this to automatically read the dir with the pictures in and fill in a line as above for each picture
Pete .
From a terminal, in the directory above "stagepics", try something like:
for f in stagepics/*jpg ; do echo \ "<a class=\"thumbnail\">...<img src=\"$f\" width=\"100px\" />...</a>" ; done > pics.html You can put that all on one line, but it should work split over three as above. Insert the other HTML you need where the "..." bits are. Just watch the quoting - all the double quotes in the HTML need to be escaped as \". Also, the above will create/overwrite "pics.html", make sure nothing with that name already exists :) HTH, Tim -- Tim Serong <tserong@novell.com> Senior Clustering Engineer, OPS Engineering, Novell Inc. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org