Added.
parent
9b1dba8fdf
commit
eed6de3818
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Assuming the notes field of a host.cfg file is "notes\s<lat> <lon>" then print them out
|
||||||
|
|
||||||
|
files=""
|
||||||
|
|
||||||
|
while [ -n "$1" ]; do
|
||||||
|
case "$1" in
|
||||||
|
-f|--file) files="$2"; shift 2;;
|
||||||
|
*) shift 1;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
for file in `egrep -l notes $files`; do
|
||||||
|
awk '/host_name/ {host=$2}; /notes/ {lat=$2; lon=$3} END {print host, lat, lon}' $file
|
||||||
|
done
|
||||||
|
|
||||||
Loading…
Reference in New Issue