Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/3/84; site panda.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!harvard!talcott!panda!dpn
From: dpn@panda.UUCP (Dale P. Nielsen)
Newsgroups: net.unix-wizards
Subject: Re: AWK question
Message-ID: <688@panda.UUCP>
Date: Tue, 6-Aug-85 09:25:37 EDT
Article-I.D.: panda.688
Posted: Tue Aug  6 09:25:37 1985
Date-Received: Fri, 9-Aug-85 02:11:48 EDT
References: <435@brl-tgr.ARPA>
Reply-To: dpn@panda.UUCP (Dale P. Nielsen)
Organization: GenRad, Inc., Concord, Mass.
Lines: 27

In article <435@brl-tgr.ARPA> ddaly%xls-plexus01.amc@AMC-HQ.ARPA (DUSTY) writes:
>Does anyone know if and how I can get awk to do a >= (less than or equal)
>on a value entered from a terminal by the user?
>E.G.
>echo 'enter date in format yy-mm-dd \c $dt'
>read  dt
>echo $dt
>awk '$5  >= $dt ' .suspfile >xout
>
>awk seems to ignore the terminal entered data. Is there any way to get
>awk to recognize this kind of variable?
>
>ed daly
>ddaly at amc-hq

How about:

awk '$5 >= "'"$dt"'"' .suspfile >xout

this way the shell variable $dt get translated before awk gets it.

-- 

					--Dale P. Nielsen


"Well, that's all fuel under the reactor now, Mr. Time!"