Search Results

Search: Posts Made By: trimike
985
Posted By bartus11
awk -F":" '{sub("^[ \t]+","",$2);$1=$1":";printf...
awk -F":" '{sub("^[ \t]+","",$2);$1=$1":";printf "%-15s%s\n",$1,$2}' file
1,588
Posted By shamrock
how about doing it all inside of awk... awk...
how about doing it all inside of awk...

awk '$0 !~ "^#" {
ip[$1]++
h[$2]++
} END {
for(i in ip) if(ip[i]>1) print "dup ips "i
for (j in h) if (h[j]>1) print "dup host "j
}' /etc/hosts
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 05:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy