0

I am trying to grep a pattern from a growing log file and redirect it to another file. I saw some suggestions like :

tailf log | grep --line-buffered "pattern" >> new_file

But this works on Linux i guess, I am using AIX 5.3 Please help ! Thanks much in advance.

  • did you mean `tail -f` ? Use 4 spaces at the front of your code/data lines to have them format properly. On AIX search for `unbuffer` and use that (in front of tail -f` ). Good luck. – shellter Nov 16 '15 at 15:06
  • unable to find unbuffer on AIX, but anyways, thanks for your qucik reply. – ananth raman Nov 16 '15 at 15:25
  • I'm almost sure I found it when I worked on AIX in a non-standard dir, which I had to add to my path (not certain). It's installed as part of `expect`, so see if your sysAdmins know if it is available. Also (low probability), look for `stdbuf`. Also I searched on S.O. There are quite a few answers. The accepted answer for http://stackoverflow.com/questions/3465619/how-to-make-output-of-any-shell-command-unbuffered has a link that may help. Good luck! – shellter Nov 16 '15 at 15:40
  • You could install GNU grep... – Zsigmond Lőrinczy Nov 16 '15 at 18:25

1 Answers1

0

tail -f | grep -u Should work on AIX, I tested it is working fine.