#!/usr/bin/awk -f BEGIN { if (DIME == "") { print "ERRORE: variabile DIME non dichiarata" > "/dev/stderr" CODICE = 1 } else { if (FILE == "") { print "ERRORE: variabile FILE non dichiarata" > "/dev/stderr" CODICE = 2 } else { COMANDO = "ls -o " ESEGUI = COMANDO FILE " 2> /dev/null" if (ESEGUI | getline != 1) { print "ERRORE nell'esecuzione del comando " COMANDO FILE > "/dev/stderr" CODICE = 3 } else { print "Scaricati", ($4/1024), "KB,", ($4/1048576), "MB di", (DIME/1024), "KB,", (DIME/1048576), "MB totali (" ($4*100/DIME), "%)"} } } exit CODICE }