Giuseppe’s Weblog

Just another WordPress.com weblog

Manipolare stringhe in Unix

lascia un commento »

SED script per trasformare ^V^M

Per troncare tutte gli spazi in fondo alle righe di un file terminanti con <newline><linefeed> (^V^M) usare il seguente comando:

sed 's/'\ *"$(printf '15')"'$//g' file_di_input > file_di_output

AWK stampare una colonna con separatore

cat passwd|awk 'BEGIN { FS = ":" } ; { print $1 }'>readers

Scritto da gfiorito

dicembre 21, 2009 a 3:50 pm

Pubblicato in HowTo, Linux

Lascia un Commento

Fill in your details below or click an icon to log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Log Out / Modifica )

Foto Twitter

You are commenting using your Twitter account. Log Out / Modifica )

Foto di Facebook

You are commenting using your Facebook account. Log Out / Modifica )

Connecting to %s

Follow

Get every new post delivered to your Inbox.