(command.CommandList children: [ (command.ShFunction name: usage body: (BraceGroup children: [ (C {<echo>} {<Usage> <Id.Lit_Colon ':'>} { (command_sub left_token: <Id.Left_Backtick '`'> child: (C {<basename>} {($ Id.VSub_Number '$0')}) ) } {(DQ <'[-h] [-D] [-C ca_name]'>)} {(DQ <'[-P ca_port] [-t(imeout) timeout_ms]'>)} ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<2>}) ] ) ) (command.ShFunction name: dump_by_lid body: (BraceGroup children: [ (command.ForEach iter_name: sw_lid iter_words: [ { (command_sub left_token: <Id.Left_Backtick '`'> child: (command.Pipeline children: [ (C {<ibswitches>} {($ Id.VSub_DollarName '$ca_info')}) (C {<sed>} {<-ne>} {(SQ <'s/^.* lid \\([0-9a-f]*\\) .*$/\\1/p'>)}) ] negated: F ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (C {<ibroute>} {($ Id.VSub_DollarName '$ca_info')} {($ Id.VSub_DollarName '$sw_lid')} ) ] ) ) ] ) ) (command.ShFunction name: dump_by_dr_path body: (BraceGroup children: [ (command.ForEach iter_name: sw_dr iter_words: [ { (command_sub left_token: <Id.Left_Backtick '`'> child: (command.Pipeline children: [ (C {<ibnetdiscover>} {($ Id.VSub_DollarName '$ca_info')} {<-v>}) (C {<sed>} {<-ne>} { (SQ < '/^DR path .* switch /s/^DR path \\([,|0-9]\\+\\) ->.*{\\([0-9|a-f]\\+\\)}.*$/\\2 \\1/p' > ) } ) (C {<sort>} {<-u>}) (C {<awk>} {(SQ <'BEGIN {guid=0;} {if ($1 != guid) { guid=$1; print $2; }}'>)}) ] negated: F ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (C {<ibroute>} {($ Id.VSub_DollarName '$ca_info')} {<-D>} {(${ Id.VSub_Name sw_dr)}) ] ) ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:use_d) op: assign_op.Equal rhs: {(DQ )} spids: [214] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ca_info) op: assign_op.Equal rhs: {(DQ )} spids: [218] ) ] ) (command.WhileUntil keyword: <Id.KW_While while> cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_RBracket ']'>}) terminator: <Id.Op_Semi _> ) ] body: (command.DoGroup children: [ (command.Case to_match: {($ Id.VSub_Number '$1')} arms: [ (case_arm pat_list: [{<-D>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:use_d) op: assign_op.Equal rhs: {(DQ <-D>)} spids: [248] ) ] ) ] spids: [244 245 254 -1] ) (case_arm pat_list: [{<-h>}] action: [(C {<usage>})] spids: [257 258 264 -1] ) (case_arm pat_list: [{<-P>} {<-C>} {<-t>} {<-timeout>}] action: [ (command.Case to_match: {($ Id.VSub_Number '$2')} arms: [ (case_arm pat_list: [{<-> <Id.Lit_Star '*'>}] action: [(C {<usage>})] spids: [290 292 298 -1] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<x> ($ Id.VSub_Number '$2')} {<Id.Lit_Equals '='>} {<x>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [(C {<usage>})] spids: [304 319] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ca_info) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$ca_info') <' '> ($ Id.VSub_Number '$1') <' '> ($ Id.VSub_Number '$2') ) } spids: [328] ) ] ) (C {<shift>}) ] spids: [267 280 341 -1] ) (case_arm pat_list: [{<-> <Id.Lit_Star '*'>}] action: [(C {<usage>})] spids: [344 346 352 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [(C {<usage>})] spids: [355 356 362 -1] ) ] ) (C {<shift>}) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$use_d'))} {<Id.Lit_Equals '='>} {(DQ <-D>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [(C {<dump_by_dr_path>})] spids: [373 391] ) ] else_action: [(C {<dump_by_lid>})] ) (command.ControlFlow token:<Id.ControlFlow_Exit exit>) ] )