Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I rewrite the terminal output of a program
    text
    copied!<p>I'm running an application (CoronaSDK Simulator) from the terminal that puts an insanely long timestamp in front of every line of output.</p> <p>Is there a way to use something like sed to chop it off and instead output everything else as it comes in (i.e. without having to wait until the program ends)?</p> <p>I've tried a couple of things, but have had no luck so far...</p> <p>Here are some sample lines:</p> <pre><code>2013-02-14 12:39:49.028 Corona Simulator[40803:707] |timer created 2013-02-14 12:39:49.029 Corona Simulator[40803:707] __in deck.lua__ 2013-02-14 12:39:49.030 Corona Simulator[40803:707] storyboard.roomData.layout=A1 (room.lua) </code></pre> <p>Which I want to look like this:</p> <pre><code>|timer created __in deck.lua__ storyboard.roomData.layout=A1 (room.lua) </code></pre> <p>I have tried</p> <pre><code>coronasim ./ | sed 's/Corona Simulator//' </code></pre> <p>as a test, and </p> <pre><code>coronasim ./ | sed -e 's/^.* //' </code></pre> <p>as suggested below, and even</p> <pre><code>coronasim ./ &gt; /dev/null </code></pre> <p>but nothing seems to change the output.</p> <p>The solutions was this:</p> <pre><code>coronasim ./ 2&gt;&amp;1 | sed -e 's/^.*] //' </code></pre> <p>as per choroba's suggestion below. Seems that the Corona SDK simulator sends output to stderr instead of stdout.</p> <p>And for anyone else interested, created a simple bash script that runs the program in the current director in the simulator, stripping out the timestamps:</p> <pre><code>/Applications/CoronaSDK/Corona\ Simulator.app/Contents/MacOS/Corona\ Simulat or ./ 2&gt;&amp;1 | sed -e 's/^.*] //' </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload