well, on and off, I've used this script for a while now, depending on how often I feel like putting more files on the server, it looks like apache now deals quite well with spaces, and thanks to some nice file renaming programs (thunar) and other things linuxy, I now have a much nicer file list.
when porting code from one windoze machine to linux (usually using ubuntu these days), I can open the wine version of notepad and cut and paste the text to a native linux files which takes care of the new record marker bit quite nicely
I don't remember altering the code, and the way I'm running it is just the same, so why would I start to get errors, I'm obviously doing something wrong, or I've forgotten how to use this the right way, could someone help me to remember how I do this please? ...
my code is this...
Code:
BEGIN{
print "<html>"
print "<body>"
print "<link rel=\"stylesheet\" type=\"text/css\" href=\"../1.css\">"
print "<center>"
print "<ul>"
}
{
print "<li><a href=\""gensub(/\.mp3/ , ".html" , g )"\" target=\"rhs\">"$0"</a>"
# and the other files ...
target = gensub(/\.mp3/ , ".html" , g )
print "<html>" > target
print "<body>" > target
print "<link rel=\"stylesheet\" type=\"text/css\" href=\"../2.css\">" > target
print "<center>" > target
print "<a href=\"../music/"$0"\">"$0"</a>" > target
print "</br>" > target
print "</br>" > target
print "<embed src=\""$0"\" autostart=\"true\">" > target
print "</ul>" > target
print "</center>" > target
print "</body>" > target
print "</html>" > target
close( target )
}
END{
print "</ul>"
print "</center>"
print "</body>"
print "</html>"
}
and I run it thus...
Code:
c$ awk -f 1.awk list > index.html
awk: 1.awk: line 33: function gensub never defined
awk: 1.awk: line 33: function gensub never defined
gensub never defined??? It never seemed to bother with that line before!
And why tell me twice? am I really that bad that I need telling twice?
Clearly I am *hangs head in shame*
Help me sort this out please, it's got me stumped