aboutsummaryrefslogblamecommitdiff
path: root/bin/slsf.awk
blob: 9d12225dd91d4f918d61f85bfac262af25896ab4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                                            






                                                                             

                                       
# Print the first non-glob "Host" name from each line of ssh_config(5) files

# Manage the processing flag (starts set in each file)
FNR == 1 || /### sls/ { sls = 1 }
/### nosls/ { sls = 0 }

# If processing flag set, directive is "Host", and hostname has no wildcards,
# then print it
!sls { next }
$1 == "Host" && $2 !~ /\*/ { print $2 }