🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: demon.ip.developers
Article #169

Re: grep 'n edit, I wish!

#169
From: Walter Briscoe
Date: Wed, 11 Nov 1998 00:00
31 lines
1786 bytes
In article <910784101snz@wash.demon.co.uk>, John Washington
<john$@wash.demon.co.uk> writes
[snip]
>I constantly find myself typing things like:
>
>        grep foobar *.c
>        [pause to eyeball result]
>        edit thisfile.c thatfile.c tother.c yafile.c etc.c
>
>And that really bugs me.  The damn computer knows which files
>I want already.  I could even have used the -l option in grep
>to get a little list of them.
It knew the files which measured up before you threw the information
away. tee may be useful. Unfortunately, doze does not have a true pipe
capability. e.g. command1 | command2 is roughly equivalent to
command1 > tmpfile
command2 < tmpfile
del        tmpfile

Consequence is that none of the results of command2 comes out before
command 1 finishes. 
[snip]

In Unix, I solve such problems with a script which takes arguments of a
searchstring and a filespec. find generates filelist; grep -l filters
it; $VISUAL (elvis, vim or vi) edits each file in turn. It took me ages
to appreciate I REALLY needed such a tool. It might be possible to right
your own piping code to exchange the problems with gates code for your
own.
-- 
Walter Briscoe
Technical Details
Message-ID: <PTo2MWAoChS2Ewh4@wbriscoe.demon.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <910784101snz@wash.demon.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bb05,f355ae5d069fba47
X-Google-Attributes: gid10bb05,public
From: Walter Briscoe <walter@wbriscoe.demon.co.uk>
Subject: Re: grep 'n edit, I wish!
Date: 1998/11/11
Message-ID: <PTo2MWAoChS2Ewh4@wbriscoe.demon.co.uk>
X-Deja-AN: 410888100
X-NNTP-Posting-Host: wbriscoe.demon.co.uk:158.152.165.177
References: <910784101snz@wash.demon.co.uk>
X-Complaints-To: abuse@demon.net
X-Trace: news.demon.co.uk 910826125 nnrp-03:721 NO-IDENT wbriscoe.demon.co.uk:158.152.165.177
MIME-Version: 1.0
Newsgroups: demon.ip.developers