#76 Displaying Random Text

The built-in server-side include features offer some wonderful ways to expand and extend your website. One way that's a favorite with many webmasters is the ability to have an element of a web page change each time the page is loaded. The ever-changing element might be a graphic, a news snippet, or a featured subpage, or it might just be a tag line for the site itself, but one that's slightly different for each visit to keep the reader interested and — hopefully — coming back for more.

What's remarkable is that this trick is quite easy to accomplish with a shell script containing an awk program only a few lines long, invoked from within a web page via an SSI include (see Script #75 for an example of SSI directive ...

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.