grazinggoat
Programmer
I'm trying to parse the following
I want to get a total of UP/DOWN from doing a status:
apps_status
sys1 UP
sys2 UP
sys3 DOWN
sys4 UP
right now I am doing
app_status |awk 'NR>1 { r[$2]++ } END {for (i in r) print r, i}'
how do i grep on up and down to feed into NR ?
so that I have UP=4 DOWN =1 ?
I want to get a total of UP/DOWN from doing a status:
apps_status
sys1 UP
sys2 UP
sys3 DOWN
sys4 UP
right now I am doing
app_status |awk 'NR>1 { r[$2]++ } END {for (i in r) print r, i}'
how do i grep on up and down to feed into NR ?
so that I have UP=4 DOWN =1 ?