January 2004
Intermediate to advanced
368 pages
7h 25m
English
CGI shell scripts aren't limited to working with text. A common use of websites is to have a photo album that allows you to upload lots of pictures and that has some sort of software to help organize everything and make it easy to browse. Surprisingly, a basic "proof sheet" of photos in a directory is quite easy to produce as a shell script. Here's one that's only 44 lines.
#!/bin/sh # album - online photo album script echo "Content-type: text/html" echo "" header="header.html" footer="footer.html" count=0 if [ -f $header ] ; then cat $header else echo "<html><body bgcolor='white' link='#666666' vlink='#999999'><center>" fi echo "<h3>Contents of $(dirname $SCRIPT_NAME)</h3>" echo "<table cellpadding='3' ...
Read now
Unlock full access