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 grep flushes its output when it writes to stdout but not to a file.
grep --line-buffered will force grep to output each line as it's processed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With