[ LUGOS ] odstranitev presledkov in koncev vrstic iz datoteke
    Lego Andy 
    andy na x0.org
       
    Pet Maj  5 19:33:55 CEST 2000
    
    
  
> Zanima me kako bi lahko iz neke datoteke ali pa iz stdin izbrisal vse presledke
> od za?etka vrstice, do prve ?rke in od zadnje ?rke do konca vrstice in vse
> konce vrstic (newline), tako, da bi bil tekst iz ve?vrsti?ne datoteke ves v eni
> vrstici.
#!/usr/bin/perl -w
while(<>){
  s/^\s*//;
  s/\s*$/ /;
  print;
}
print "\n";
To das v file recimo a.pl, pol pa reces:
cat whatever | perl a.pl
Varjanta b:
cat text | perl -ne "s/^\s*//; s/\s*$/ /; print"
			Andy
-- 
------------------------------------------------
  |\      _,,,,--,,_    E-MAIL: andy na x0.org
  /,`.-'`'    -,  \-;,	ICQ:    10024539
 |,4-  ) ),,__ ,\ (  ;;	URL: http://andy.x0.org
'---''(.'--'  `-'`.)`'	TEL: 301 725 5724
------------------------------------------------
    
    
Dodatne informacije o seznamu Starilist