Breakout ^12**1944, France.**A trapped company of Allied troops have stolen a Tiger tank and are attempting to force their way through encircling Axis lines!
Using standard tools of a Linux system, like sed and awk, you can automate code generation for some highly repetitive code fragments, like the one in the following example:
Suppose you want to display a table of smilies that are available on your system. Each row should show the smiley and the code needed to insert it in an article. The code that does the job is
phpnuke-faq-code-1, for only one smiley, icon_smile.gif:
To automate the code generation process for all the smilies you have, do:
cd /usr/local/httpd/htdocs/nuke6/html
ll modules/Forums/images/smiles/* | awk '{print $9}' > smilies
That is, you change to the html directory, list all smilies from the modules/Forums/images/smiles directory and let awk print the 9th field of each line - this is the file name of the smiley. The
output is redirected to the smilies file, which will thus contain a list of all smiley filenames.