I have a case where I want to take the output of a command that shows what debug trace types are enabled and programmatically disable them. The output of the command is as follows (partial output shown):
Registered Trace Type(s) | Trace id(s) currently enabled
--------------------------------------------------------
TRACE_PTAP
No trace(s) enabled!
RING_TRACE
All trace(s) enabled!
RING_EVENTS
No trace(s) enabled!
TRACE_DSPCFG
No trace(s) enabled!
TRACE_DSP
All trace(s) enabled!
TRACE_CMD_HANDLER
No trace(s) enabled!
CPU_MON
No trace(s) enabled!
--------------------------------------------------------
Notice that the token 'No/All trace(s) enabled!' is on a separate line from the trace type. Spaces are used to line up the tokens into a column.
I want to get all the trace types that have 'All trace(s) enabled!' from the response, put them in a list then use a while loop to disable them.
I think the best way to map the output is to use a block response map, but I am not sure how to deal with the repetitive tokens and how to extract the trace types into a list.
Thanks in advance.