🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1011

Re: bourne shell query

#1011
From: James Brister
Date: Thu, 30 Aug 1990 16:59
23 lines
1335 bytes
On 30 Aug 90 00:56:38 GMT,
fred@maccs.dcss.mcmaster.ca (Fred Whiteside) said:

> #!/bin/sh
> cd /usr/spool/news/comp/std/c
> zots=$1
> echo "Should ignore files with name < $zots"
> files=`ls -rt * |grep -v '.*[a-zA-Z].*' | awk $1 '>=' $zots {print}`
> echo $files

I changed the next to last line to this:
files=`ls -rt * |grep -v '.*[a-zA-Z].*' | awk '$1 >= '$zots' {print}'`


Awk expects its program to be one argument. You've given it four. You DON'T
want the $1 to be expanded, but you DO want the $zots to be expanded, hence
the funny quoting.

James
--
James Brister                                           brister@decwrl.dec.com
DEC Western Software Lab., Palo Alto, California.         .....!decwrl!brister
Technical Details
Message-ID: <BRISTER.90Aug30125933@westworld.decwrl.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!udel!haven!decuac!bacchus.pa.dec.com!decwrl!brister
References: <26DC6447.15922@maccs.dcss.mcmaster.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!udel!haven!decuac!bacchus.pa.dec.com!decwrl!brister
From: brister@decwrl.dec.com (James Brister)
Newsgroups: comp.unix.shell
Subject: Re: bourne shell query
Message-ID: <BRISTER.90Aug30125933@westworld.decwrl.dec.com>
Date: 30 Aug 90 16:59:33 GMT
References: <26DC6447.15922@maccs.dcss.mcmaster.ca>
Sender: news@wrl.dec.com (News)
Organization: DEC Western Software Lab
Lines: 23
In-Reply-To: fred@maccs.dcss.mcmaster.ca's message of 30 Aug 90 00:56:38 GMT
X-Checksum-Snefru:  4373a440 1cad1b43 fe27ea12 2d3a6b95