:weather script - calling SED heads ! [longish]

David J Patrick davidjpatrick-rieW9WUcm8FFJ04o6PK0Fg at public.gmane.org
Sat Oct 2 19:06:05 UTC 2004


On Sat, 2004-10-02 at 14:37, William Park wrote:
> Try
>     weather.pl | ( while read a eq b; do
> 	case $a in 
> 	    celsius|conditions|humidity|pressure|wind) echo "$a = $b" ;;
> 	    place) place=$b ;;
> 	    updated) updated=$b ;;
> 	esac
>     done 
>     echo "$place @ ${updated% on *}"
>     ) | sort
> 
> Or, if you need 'weather.sc' file, then
>     weather.pl > weather.sc
>     ( ... ) < weather.sc | sort

After several variations, attempting to follow instructions, I still
have the weather block unchanged!

MATCH:
        celsius = 14
        pressure = 30.00 in / 1016 hPa 
        temperature_celsius = 14
        place = Toronto
        windchill_celsius = 
        wind = 23 mph 37 km/h from the WNW 
        fahrenheit = 57
        updated = 2:18 PM EDT on October 02, 2004
        windchill_fahrenheit = 
        conditions = Scattered Clouds
        temperature_fahrenheit = 57
        humidity = 63


using 

    weather.pl > weather.sc
    ( while read a eq b; do
        case $a in 
            celsius|conditions|humidity|pressure|wind) echo "$a = $b" ;;
            place) place=$b ;;
            updated) updated=$b ;;
        esac
    done 
    echo "$place @ ${updated% on *}"
    ) < weather.sc | sort


Am I an idjit, or what ?
djp 

--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list