programming in bash Shell

Giorgos Keramidas keramida at ceid.upatras.gr
Fri Mar 10 00:41:16 EET 2000


On Fri, Mar 10, 2000 at 02:34:56AM +0200, Olga +Natalia wrote:
> 
> --------------FBDEB3E142BF75BDB5F3A976
> Content-Type: text/plain; charset=iso-8859-7
> Content-Transfer-Encoding: 7bit
> 
> Paidia , gia boi8iste me ligo dioti exw kollisei se ayto to simeio
> arketes imeres.
>  de me endiaferei an i ylopoiisi tou 8a einai me awk i me sed i me kati
> allo
>  (an kai egw  nomizo oti einai o monadikos tropos einai me xrisi tis,
> gawk)
> 
> Ftiaxnw enan pinaka pliroforiwn  to opoio exei 3 pedia
>    ID, First-name , Last-name,   pou einai ta $1, $2, $3 antistoixa
> 
> Paradeigma-1 :
> exw to arxeio "step-ena" to opoio apoteleitai apo 8 grammes :
> 
> $cat  step-ena
> 1    Olga      Makri
> 2    Natalia  Kontou
> 3    Maria    Kamprianou
> 4    Eleni      Drakou
> 5    Lena      Matra
> 6    Dimitra   Lykopoulou
> 7    Alejia     Manta
> 8    Anna      Kotsopoulou
> 
>  Afairw gia paradeigma tin grammi 5 apo to arxeio "step-ena" me tis
> entoles :

Gia na to kaneis me perl, dokimase:

    echo "Poia grami na sbisw apo to arxeio? dwse ID: "
    read deleteID
    grep -v "^${deleteID}" step-ena |\
      perl -e '$|=1;
	$no=0;
	while(defined($line=<STDIN>)) {
	  chomp $line;
	  @data = split $line;
	  print "$no $data[1] $data[2]\n";
	  $no++;
	}' > neo-arxeio

Einai ontws megalutero.

-- 
Giorgos Keramidas, < keramida @ ceid . upatras . gr >
For my public PGP key: finger keramida at diogenis.ceid.upatras.gr
PGP fingerprint, phone and address in the headers of this message.
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at hellug.gr
Ta archives tis listas einai sto http://lists.hellug.gr/lgu.html
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users at hellug.gr
====================================================================



More information about the Linux-greek-users mailing list