bag cat¶
Synopsis¶
bag cat [OPTIONS] INPUT-FILE1 or - [INPUT-FILE2 ...]
Description¶
Like UNIX cat, the bag cat program makes a stream of data available on its standard output stream. Unlike UNIX cat, the data is obtained by processing log files.
See also
- Common Commandline Options
- The usual RSB-related commandline options are accepted.
- IDL-related Commandline Options
- The usual IDL-related commandline options are accepted.
- Replay-related Options
- The usual replay-related commandline options are accepted.
-
--target-stream
STREAM-NAME
¶ Stream to which produced output should be sent. Allowed values for
STREAM-NAME
:stdout
,standard-output
,stderr
,error-output
Examples¶
$ bag cat isr.tide | head <sr db_start="80" db_utt="80" /> <sr db_start="45" db_utt="46" /> <?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...] <?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...] <?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...] <?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...] <?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...] <speech_hyp xmlns:bxml="http://www.sleepycat.com/2002/dbxml" [...] <TIMESTAMP>1290275288296</TIMESTAMP>
The above examples demonstrates retrieving and printing the complete contents of the log file
isr.tide
. In this example, all payloads are XML documents and therefore strings. All payload strings are simply concatenated and printed. Note how this leads to individual events not being easily recognizable.$ bag cat -c 'hyp' -c 'param' /tmp/nao.tide
The above example prints the contents of all channels matching one of the regular expressions
hyp
andparam
.$ bag cat --style 'programmable/template :template "${create} ${data}\\n"' mydata.tide 2011-12-13T17:03:25.533535+01:00 blup 2011-12-13T17:03:25.534054+01:00 blup 2011-12-13T17:03:25.534121+01:00 blup [...]
This example uses the
programmable/template
formatting style to print each event of the log filemydata.tide
on a single line.${create}
expands to thecreate
timestamp and${data}
expands to the payload. Note the final\\n
.
Caveats¶
- Individual entries can no longer be distinguished (unless some in-band properties permit this) - see first example above.
- If multiple channels are printed, the channel from which a given part of the output originated is no longer apparent (unless some in-band properties allow determining this)
- Printing channels which contain binary content to a terminal may mess up the terminal and cause all sorts of mayhem