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