[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Re: Sed: acquisire campo più a dx?



MaX writes:
 > devi estrarre riga per riga quello che c'è dal 4º campo in poi?
 > 
 > usa cut, è molto più semplie e rapido.

Usare cut non fa imparare sed. Con cut ci fai solo cut. Con sed puoi
implementare molti comandi della shell, ci hai mai pensato?

Forse questa è più utile per imparare sed:

sed -e 's/[ \t]*\([^ \t]\+ \)\{3\}//'
           
o con una regexp più leggibile

sed --regexp-extended -e 's/[ \t]*([^ \t]+ ){3}//'

La coppia \t va sostituita con un carattere tab.

-- 
 /\           ___                                    Ubuntu: ancient
/___/\_|_|\_|__|___Gian Uberto Lauri_____               African word
  //--\| | \|  |   Integralista GNUslamico            meaning "I can
\/                 coltivatore diretto di software       not install
     già sistemista a tempo (altrui) perso...                Debian"

Warning: gnome-config-daemon considered more dangerous than GOTO


Reply to: