3 ms·
Cute rewrites, but I think you could do better a lot of the time. For example rather than using `cat`, `grep`, and `cut`, just use awk: function dns_name
by stevekemp 9y ago
Cute rewrites, but I think you could do better a lot of the time.
For example rather than using `cat`, `grep`, and `cut`, just use awk:
function dns_nameserver() {
awk '/nameserver/ {print $2}' /etc/resolv.conf
}
- skanga 9y agoNice. Will do.