[opensuse] Script wizards help needed
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 . PS the web site is "qmc.org.uk" click on Photo Galleries and the D'Isis . -- Powered by openSUSE 11.3 (x86_64) Kernel: 2.6.34.7-0.7-desktop KDE Development Platform: 4.6.00 (4.6.0) 09:05 up 2 days 23:02, 4 users, load average: 0.23, 0.18, 0.10 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
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
On Tuesday 26 April 2011 09:31:22 Tim Serong wrote:
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 Hi Tim
Right think it is close but not being a bash wiz i am getting an error that does not make sense to me i have for f in stagepics/*jpg ; do echo \"<a class=\"thumbnail\" href=\"#thumb\"><img src=\"$f\" width=\"100px\" height=\"75px\" border=\"0\"><span><img src=\"$f\"></span></a>\" ; done > pics.html when i run it i get syntax error near unexpected token `<' and i be jiggered if i can find the problem .. Pete . -- Powered by openSUSE 11.3 (x86_64) Kernel: 2.6.34.7-0.7-desktop KDE Development Platform: 4.6.00 (4.6.0) 11:34 up 3 days 1:31, 5 users, load average: 1.00, 0.88, 0.48 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 4/26/2011 at 08:37 PM, Peter Nikolic <p.nikolic1@btinternet.com> wrote:
On Tuesday 26 April 2011 09:31:22 Tim Serong wrote:
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 Hi Tim
Right think it is close but not being a bash wiz i am getting an error that does not make sense to me i have for f in stagepics/*jpg ; do echo \"<a class=\"thumbnail\" href=\"#thumb\"><img src=\"$f\" width=\"100px\" height=\"75px\" border=\"0\"><span><img src=\"$f\"></span></a>\" ; done > pics.html
when i run it i get syntax error near unexpected token `<'
and i be jiggered if i can find the problem ..
Leave the outermost quotes as regular quotes, just the ones inside need to be escaped, e.g.: echo "<a class=\"thumbnail\" ... >" Regards, 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
On Tuesday 26 April 2011 11:54:45 Tim Serong wrote:
On 4/26/2011 at 08:37 PM, Peter Nikolic <p.nikolic1@btinternet.com> wrote:
On Tuesday 26 April 2011 09:31:22 Tim Serong wrote:
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
Hi Tim
Right think it is close but not being a bash wiz i am getting an error that does not make sense to me i have
for f in stagepics/*jpg ; do echo \"<a class=\"thumbnail\"
href=\"#thumb\"><img src=\"$f\" width=\"100px\" height=\"75px\" border=\"0\"><span><img src=\"$f\"></span></a>\" ; done > pics.html
when i run it i get syntax error near unexpected token `<'
and i be jiggered if i can find the problem ..
Leave the outermost quotes as regular quotes, just the ones inside need to be escaped, e.g.:
echo "<a class=\"thumbnail\" ... >"
Regards,
Tim Thanking you muchly that fixed it sopt on
Pete . -- Powered by openSUSE 11.3 (x86_64) Kernel: 2.6.34.7-0.7-desktop KDE Development Platform: 4.6.00 (4.6.0) 11:57 up 3 days 1:54, 5 users, load average: 0.16, 0.16, 0.23 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hello, On Tue, 26 Apr 2011, Tim Serong wrote:
On 4/26/2011 at 08:37 PM, Peter Nikolic <p.nikolic1@btinternet.com> wrote:
Right think it is close but not being a bash wiz i am getting an error that does not make sense to me i have for f in stagepics/*jpg ; do echo \"<a class=\"thumbnail\" href=\"#thumb\"><img src=\"$f\" width=\"100px\" height=\"75px\" border=\"0\"><span><img src=\"$f\"></span></a>\" ; done > pics.html
when i run it i get syntax error near unexpected token `<'
and i be jiggered if i can find the problem ..
Leave the outermost quotes as regular quotes, just the ones inside need to be escaped, e.g.:
echo "<a class=\"thumbnail\" ... >"
Using a here-document will make the quoting and formatting a lot easier. $ for f in stagepics/*jpg; do cat <<EOF ; done > pics.html <a class="thumbnail" ...> ... <img src="$f" width="100px" /> ... </a> EOF HTH, -dnh -- I am the "ILOVEGNU" signature virus. Just copy me to your signature. This message was infected under the terms of the GNU General Public License. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
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 .
PS the web site is "qmc.org.uk" click on Photo Galleries and the D'Isis .
--
How about jalbum http://jalbum.net/ --- Sent from my Suse Linux Desktop. --- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (4)
-
David Haller
-
ka1ifq
-
Peter Nikolic
-
Tim Serong