Skip to main content

Timeline for output while reading keyboard input

Current License: CC BY-SA 3.0

13 events
when toggle format what by license comment
Jun 2, 2013 at 21:10 history tweeted twitter.com/#!/StackUnix/status/341300894207447040
Jun 2, 2013 at 16:28 comment added kadamwolfe Agreed. Which is why I am leaning toward tail -f /var/log/java-app.log | tee >( grep -q "YADA YADA" ) instead. Grep will exit when it finds the match I am looking for and the script moves to the next step. If I see it failing I can ctrl+C.
Jun 2, 2013 at 16:10 comment added Anthon Yeah I understand that, but e.g. you repeat the tail and there might be to many lines passed already, so you miss things, or not enough, so you see things multiple times. In my program I record the size of the log, and display additional bytes/lines, after checking for keyboard events.
Jun 2, 2013 at 16:08 history edited Hauke Laging CC BY-SA 3.0
retagged; improved title (more general)
Jun 2, 2013 at 16:03 comment added kadamwolfe Well, that's the thing. I need those non-interesting lines to check for errors. Basically I'm starting up several JVMs across about 10 servers. I need to see all of the output. When I see it's "started successfully" I want it to continue onto the next JVM or server. If I see errors I want the whole script to die.
Jun 2, 2013 at 14:25 answer added Hauke Laging timeline score: 1
Jun 2, 2013 at 6:53 comment added Anthon You don't seem to be observing that your program might already have exited while watching the log. In a similar situation (I had to scan the output from the process as well as a log) I ended up writing a program that looped while 1) scanning for keyboard input 2) write out output and log to stdout for visual check (suppressing non-interesting lines). This was extended over time with 3) automated scanning for patterns in log and output. I am not sure if you can do that as easily with shell programming.
S Jun 2, 2013 at 6:45 history edited Anthon CC BY-SA 3.0
formatting
S Jun 2, 2013 at 6:45 history suggested user2354329 CC BY-SA 3.0
formatting
Jun 2, 2013 at 6:43 review Suggested edits
Jun 2, 2013 at 6:45
Jun 2, 2013 at 4:50 history edited kadamwolfe CC BY-SA 3.0
added 156 characters in body
Jun 2, 2013 at 4:49 review First posts
Jun 2, 2013 at 4:50
Jun 2, 2013 at 4:29 history asked kadamwolfe CC BY-SA 3.0