Article View: ca.unix
Article #1111grep question
From: Dan
Date: Sun, 07 May 1995 00:00
Date: Sun, 07 May 1995 00:00
17 lines
897 bytes
897 bytes
Grep "string" * returns lines containing the string preceded with the
filename:
filea:"xxxxxxxxxxstringxxxxxxxxxxxx"
fileb:"xxxxxxxxxxxxxxxxxxstringxxxx"
etc.
Unfortunately, 'head -20 * |grep "string" will not return the file name
because grep operates on the results from 'head'. Anyone know of a way
to restrict grep to search only the first 20 lines of a file OR a way
to make the head/grep piped command display the filename?
-thanx
-dan
--
Dan <kolohe@rahul.net>
Technical Details
Message-ID:
<3ohlb8$44h@hustle.rahul.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10183f,c3c7cc1ab80bf082,start X-Google-Attributes: gid10183f,public From: Dan <kolohe@rahul.net> Subject: grep question Date: 1995/05/07 Message-ID: <3ohlb8$44h@hustle.rahul.net> X-Deja-AN: 102153756 distribution: world organization: a2i network nntp-posting-user: kolohe newsgroups: ca.unix