Matic wrote:
Iz neke datoteke s tekstom bi rad dobil vrstico ki vsebuje "Besedo" +
sledeih n vrstic. Kako in s im?
lp,
Matic
--
Chemist who falls in acid is absorbed in work.
Oh... man grep
grep -A n pattern file
Matic
--
Chemist who falls in acid is absorbed in work.
On Mon, 24 Jan 2000 18:12:28 +, Matic wrote:
Iz neke datoteke s tekstom bi rad dobil vrstico ki vsebuje "Besedo" +
slede ih n vrstic. Kako in s im?
grep -An Beseda *
GreetZ, Stojan
On Mon, Jan 24, 2000 at 06:12:28PM +, Matic wrote:
Iz neke datoteke s tekstom bi rad dobil vrstico ki vsebuje "Besedo" +
sledeih n vrstic. Kako in s im?
Verjetno se da to lepse narediti z awkom. Ampak ker awka ne poznam in
sem vajen razmisljati v perlu naredim takole:
#!/usr/bin/perl
Iz neke datoteke s tekstom bi rad dobil vrstico ki vsebuje "Besedo" +
sledeèih n vrstic. Kako in s èim?
man grep:
-A NUM, --after-context=NUM
Print NUM lines of trailing context after matching
lines.
Torej
grep -A n "Beseda" filename