Monday 29 February 2016

Add entry in /etc/nsswitch - Solaris 11

To add DNS to /etc/nsswitch.conf
svccfg -s name-service/switch setprop config/ipnodes = astring: '("files dns")'
svccfg -s name-service/switch setprop config/host = astring: '("files dns")'
svccfg -s name-service/switch listprop config
svcadm refresh name-service/switch

Regex with awk

To use a regular expression in awk use the operator ~ and //, e.g/:
cat home-dir.txt | awk '{if ($3 !~ /^[0-9]/) print $0;}'
to print any line that does not have a number in column 3