2
rated 0 times
[
2]
[
0]
/ answers: 1 / hits: 853
/ 1 Year ago, sun, july 10, 2022, 7:48:56
I want to setup an alias or a script that will allow me show the DHCP bindings dnsmasq has.
$ cat /var/lib/misc/dnsmasq.leases
1411349054 08:11:96:e9:52:ec 192.168.1.96 W11837894 *
1411413528 b4:b6:76:0c:c9:4d 192.168.1.46 root-HP-9470m *
1411263016 00:1b:21:0e:f2:bd 192.168.1.219 root-Dell-DM061 *
1411357237 00:01:2e:4d:49:bd 192.168.1.31 ata *
1411263041 00:30:67:d2:25:65 192.168.1.51 root-TA75M *
I can take the 1st column and do a date -d @1411349054 (or awk '{print $1}' /var/lib/misc/dnsmasq.leases | awk '{ print strftime("%c")}'
)
Sun Sep 21 20:24:14 CDT 2014
I am looking for a way in awk to format like this:
Sun Sep 21 20:24:14 CDT 2014 08:11:96:e9:52:ec 192.168.1.96 W11837894 *
Mon Sep 22 14:18:48 CDT 2014 b4:b6:76:0c:c9:4d 192.168.1.46 root-HP-9470m *
Anyone have any ideas?
More From » bash