GUIDA AD AWK, 13 – to do

To do: spunti da sviluppare

 

http://www.thedevopsblog.com/sysadmin/how-tos/geekish-one-liner-linux-command-sequences/
ordinamento crescente/decrescente
echo -e “1\n \b2\n \b3\n \b4\n \b5\n \b6\n \b7\n \b8\n \b9″ | awk ‘{a[$1]}END{for (i in a) print i}’
Creazione di un array:

 echo -e "1\n \b2\n \b3\n \b4\n \b5\n \b6\n \b7\n \b8\n \b9" | awk '{a[$1]}END{for (i in a) print i}'

Inserimento dati da file (numeri) in array “a” (non ordinato):

 $ cat numeri
 01
 02
 03
 04
 05
 06
 07
 08
 09
 10
 11
 12

$ awk ‘{a[$1]}END{for (i in a) print i}’ numeri

Gawk per il calcolo del tempo (systime etc):
http://www.theunixschool.com/2013/01/gawk-date-and-time-calculation-functions.html
http://www.theunixschool.com/2013/01/gawk-calculate-date-time-difference-timestamp.html

Miscellanea: come stampare solo i primi caratteri di una stringa:
http://www.theunixschool.com/2012/05/different-ways-to-print-first-few.html

printf in C:
http://www.codingunit.com/printf-format-specifiers-format-conversions-and-formatted-output

Devops Blog:
http://www.thedevopsblog.com/sysadmin/how-tos/geekish-one-liner-linux-command-sequences/

Geek! awk add a string:
http://nixtricks.wordpress.com/2009/10/24/awk-add-another-column-from-a-second-fil/

Miscellanea molto interessante:
http://www.pement.org/awk/awk1line.txt

————————————

INDICE

 

Lascia una risposta

L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *

È possibile utilizzare questi tag ed attributi XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>