#!/bin/sh
#
# $XORP: xorp/utils/ndbg,v 1.1.1.1 2002/12/11 23:56:16 hodson Exp $
#
#
# Execute a command and strip out the preamble from XORP debug_msg
# and XLOG_* statements that are generated.
# To some minds this makes debugging harder, to others it's cleaner.
#
# Example usage:
# ndbg rib
#
# To strip the preamble of an existing log file:
# ndbg cat logfile
#
# Note: output trails sed buffering, typically 1 line.
#
if [ $# -ne 0 ] ; then
#
# Preamble begins with an opening brace '[' and ends with ']'. Careful to
# only filter lines beginning with preamble.
#
$* 2>&1 | sed -e '/^\[/ s/\[[^]]*\] //'
fi
syntax highlighted by Code2HTML, v. 0.9.1