#!/bin/sh -u # This CGI script displays the Ottawa weather temperature. # ------------------------------------------------------------------ # Syntax: $0 (no arguments) # ------------------------------------------------------------------ # Purpose: Fetch the weather in a CGI script. # No arguments are used; it only does Ottawa. # ------------------------------------------------------------------ # # Comment: the required comments are missing from this sample solution # ------------------------------------------------------------------ exec 2>&1 PATH=/bin:/usr/bin ; export PATH umask 022 LC_COLLATE=C ; export LC_COLLATE echo "Content-Type: text/plain" echo "" date echo "The Temperature in Ottawa" URL='http://text.weatheroffice.ec.gc.ca/forecast/city_e.html?on-118' lynx -dump "$URL" | grep -A 1 'Temperature:' | tr ' \n' ' ' echo ""