awk ‘/lease/{IP=$2} /ethernet/{MAC=$3} /hostname/ {HOST=substr($2,2,length($2)-3); printf(“%s – %s – %s \n”,IP,HOST,MAC)}’ < /var/lib/dhcp/dhcpd.leases |sort |uniq
Tag: shellscript
script cut para pegar os ultimos caracteres
Pegar os 4 últimos caracteres sem saber o tamanho da variável ou posição, neste exemplo retorna “este”. echo “pegarsomenteeste” | rev | cut -b-4 | rev Fonte: http://www.bestlinux.com.br/index.php/dicas/127/4993
getting lat,lon position with #shellscript http://www.linuxjournal.com/article/10589
getting lat,lon position with #shellscript http://www.linuxjournal.com/article/10589