Re: lug-bg: script...
- Subject: Re: lug-bg: script...
- From: boukov@xxxxxxxxxxx (Petko Boukov)
- Date: Tue, 18 Jan 2000 23:13:48 -0800
Mislja, che tova shte dade syshtija rezultat:
--- add.pl ---
#!/usr/bin/perl
while (<>) {
print;
print "nqkakyw tekst\n" if /regular expression za reda/;
}
--- kraj ---
Otnovo vsichki file-ove, koito podadesh kato argumenti, shte se obrabotjat i zapishat v edinen potok, no v tozi sluchaj shte mozhesh da izpolzvash i standartnija vhod kato file.
Petko
--
On Mon, 17 Jan 2000 18:13:06 Pavel Cholakov wrote:
>--- add.pl ---
>#!/usr/bin/perl
>
>$filename = shift @ARGV or die "podajte ime na fajl";
>
>open(INP, "< $filename");
>
>while (<INP>) {
> print;
> print "nqkakyw tekst\n" if /regular expression za reda/;
>}
>
>close INP;
>--- kraj ---
>
>towa chete ot fajl, dokato stigne do red, kojto otgowarq na "regular expression
>za reda", sled towa wmykwa "nqkakyw tekst\n" i prodylvawa s originalniq fajl.
>ako drug red otgowarq na syshtiq r.e. i sled nego shte byde wmyknat
>"nqkakyw tekst\n". edwa li shte swyrshi rabota w tozi si wid, oprawqj se natatyk
>... uspeh! :-)
--== Sent via Deja.com http://www.deja.com/ ==--
Share what you know. Learn what you don't.
==================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers)
Otpiswaneto RABOTI !!! : Majordomo@xxxxxxxxxxxxxxxxxx UNSUBSCRIBE LUG-BG
http://www.linux-bulgaria.org/ Hosted by Internet Group Ltd. - Stara Zagora
|