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

Re: [bash] Togliere spazi e fine riga



petdog wrote:
:) queste cose non le facevano con sed e/o awk ?

Bob


bello awk, non lo conoscevo... (non sono affatto un vero uomo:)
comunque ho cercato di fargli fare quel lavoretto e non mi riesce


Ehm ... baro ... Google: awk remove trailing blanks -> secondo risultato:


The most common and straightforward anwer to remove the trailing spaces
on all line of a file was:


cat <infile>  | sed -e 's/ *$//' > <outfile>


What this means:
-e    execute this command for every line
s     substitue
/ *$/ any number of spaces, followed by the end of the line...
//    ...with nothing


Fammi sapere :)

Bob



Reply to: