If I execute
$ java -jar selenium-server.jar 2>&1 | grep "jetty.Server"
I get, after a while, the output I expect:
$ 16:30:24.881 INFO - Started org.openqa.jetty.jetty.Server@6b0a2d64
But I i try to redirect grep output to a file, it doesn’t write a thing
$ java -jar selenium-server.jar 2>&1 | grep "jetty.Server" > /tmp/ebook_selenium
Any idea why? Thanks
We found that
grepflushes its output when it writes tostdoutbut not to a file.grep --line-bufferedwill force grep to output each line as it’s processed.