#73 Creating a Web-Based Photo Album
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.
The Code
#!/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' ...
Get Wicked Cool Shell Scripts now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.