5

how awk compare output from 'last -x' with file

view full story
linux-howto

http://www.unix.com – Hi awk masters, I need help how to compare output from 'last -x' (command cli from linux) with the file1.txt. if output from last -x is there new entry, then awk write the different in the file2.txt. example: result output from " last -x |grep 'shutdown\|reboot' " : Code: [root@localhost awk]# last -x |grep 'shutdown\|reboot' reboot  system boot  2.6.18-194.el5  Mon Jul 16 19:26          (00:09)    shutdown system down  2.6.18-194.el5  Mon Jul 16 03:36 - 19:36  (16:00)    reboot  system boot (HowTos)