Return-Path: <jmorzins@MIT.EDU>
Received: from central-city-carrier-station.mit.edu by po11.mit.edu (8.9.2/4.7) id NAA24195; Thu, 4 Apr 2002 13:11:14 -0500 (EST)
Received: from manawatu-mail-centre.mit.edu (MANAWATU-MAIL-CENTRE.MIT.EDU [18.7.7.71])
	by central-city-carrier-station.mit.edu (8.9.2/8.9.2) with ESMTP id NAA10681;
	Thu, 4 Apr 2002 13:10:46 -0500 (EST)
Received: from multics.mit.edu (MULTICS.MIT.EDU [18.187.1.73])
	by manawatu-mail-centre.mit.edu (8.9.2/8.9.2) with ESMTP id NAA17493;
	Thu, 4 Apr 2002 13:10:46 -0500 (EST)
Received: from localhost (jmorzins@localhost) by multics.mit.edu (8.9.3) with ESMTP
	id NAA06863; Thu, 4 Apr 2002 13:11:03 -0500 (EST)
Date: Thu, 4 Apr 2002 13:11:03 -0500 (EST)
From: Jacob Morzinski <jmorzins@MIT.EDU>
Reply-To: <sipb@MIT.EDU>
To: Matthew Guyton <mcguyton@mit.edu>
cc: <sipb@mit.edu>
Subject: Re: linux command help
In-Reply-To: <Pine.GSO.4.30L.0204041300590.1709-100000@buzzword-bingo.mit.edu>
Message-ID: <Pine.GSO.4.30L.0204041307110.29219-100000@multics.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Thu, 4 Apr 2002, Matthew Guyton wrote:
> I'm trying to figure out how to print out the weather forecast for today
> only:

You can either use standard sed or use GNU grep to print all lines up
to and including the match.  Both of the following two lines produce
the same output.  (I'm using ggrep from the gnu locker; linux would
have gnu grep installed as "grep".)

% athrun weather weather -f bos -h -z | sed -n '1,/Today/p'
% athrun weather weather -f bos -h -z | ggrep -B100 Today

The output is:

Zone: Suffolk County including Boston and Cambridge (MA015)
922 AM EST THU APR 4 2002
   Today: Partly sunny.  Highs near 50.  Northwest wind 10 to 20 mph.


