if you really want to use awk, you could do it like this. Actually, once c == 2 you could go ahead and call shutdown if you wanted....
awk '{if ($15 ~ /XFMRDPAD/) c++ } END { if (c > 1) system("shutdown -i6") }' StructureService_PR.log
I agree w/ the warning about automatic reboots.....
Main Topics
Browse All Topics





by: gheistPosted on 2009-05-26 at 15:22:55ID: 24478287
You should not reboot UNIX automatically.
Specifying full path to commands helps in crontab.
No "if" statements in your command line, just gawk syntax.