#!/bin/sh -u # Fetch the current Ottawa temperature from the Enviro Canada web site. # ------------------------------------------------------------------ # Syntax: $0 (no arguments) # ------------------------------------------------------------------ # Purpose: # Fetch the current Ottawa temperature from the Enviro Canada web site. # Depends on the current format of the web page. # # Bonus: Reformat the output to look good on one line. # ------------------------------------------------------------------ # # Comment: This file is missing its required comments. # ------------------------------------------------------------------ PATH=/bin:/usr/bin ; export PATH umask 022 LC_COLLATE=C ; export LC_COLLATE URL='http://weatheroffice.ec.gc.ca/city/pages/on-118_metric_e.html' lynx -dump "$URL" | grep -A 1 'Temperature' # BONUS: # lynx -dump "$URL" | grep -A 1 'Temperature' | tr '\n' ' ' | tr -s ' ' # echo