(command.CommandList
  children: [
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {<Id.Lit_LBracket '['>} {<-f>} {<'/etc/sysconfig/network'>} {<Id.Lit_RBracket ']'>})
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [(C {<.>} {<'/etc/sysconfig/network'>})]
          spids: [4 15]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:ib_sysfs)
          op: assign_op.Equal
          rhs: {(DQ <'/sys/class/infiniband'>)}
          spids: [24]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:newname)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_DollarName '$HOSTNAME'))}
          spids: [29]
        )
      ]
    )
    (command.ShFunction
      name: usage
      body: 
        (BraceGroup
          children: [
            (C {<echo>} 
              {
                (DQ <'Usage: '> 
                  (command_sub
                    left_token: <Id.Left_Backtick '`'>
                    child: (C {<basename>} {($ Id.VSub_Number '$0')})
                  ) <' [-hv] [<name>]'>
                )
              }
            )
            (C {<echo>} 
              {
                (DQ <'   set the node_desc field of all hca\'s found in '> 
                  (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) ($ Id.VSub_DollarName '$ib_sysfs') (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>)
                )
              }
            )
            (C {<echo>} {(DQ <'   -h this help'>)})
            (C {<echo>} {(DQ <'   -v view all node descriptors'>)})
            (C {<echo>} {(DQ <'   [<name>] set name to name specified.'>)})
            (C {<echo>} 
              {
                (DQ <'      Default is to use the hostname: '> 
                  (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) ($ Id.VSub_DollarName '$HOSTNAME') (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>)
                )
              }
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<2>})
          ]
        )
    )
    (command.ShFunction
      name: viewall
      body: 
        (BraceGroup
          children: [
            (command.ForEach
              iter_name: hca
              iter_words: [
                {
                  (command_sub
                    left_token: <Id.Left_Backtick '`'>
                    child: (C {<ls>} {($ Id.VSub_DollarName '$ib_sysfs')})
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} {<-f>} 
                                  {($ Id.VSub_DollarName '$ib_sysfs') <'/'> 
                                    ($ Id.VSub_DollarName '$hca') <'/node_desc'>
                                  } {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (C {<echo>} {<-n>} {(DQ ($ Id.VSub_DollarName '$hca') <': '>)})
                            (C {<cat>} 
                              {($ Id.VSub_DollarName '$ib_sysfs') <'/'> ($ Id.VSub_DollarName '$hca') 
                                <'/node_desc'>
                              }
                            )
                          ]
                          spids: [131 145]
                        )
                      ]
                      else_action: [
                        (C {<logger>} {<-s>} 
                          {(DQ <'Failed to set node_desc for : '> ($ Id.VSub_DollarName '$hca'))}
                        )
                      ]
                    )
                  ]
                )
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
          ]
        )
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: [(C {<getopts>} {(DQ <hv>)} {<flag>})]
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {($ Id.VSub_DollarName '$flag')}
              arms: [
                (case_arm
                  pat_list: [{(DQ <h>)}]
                  action: [(C {<usage>})]
                  spids: [212 215 218 -1]
                )
                (case_arm
                  pat_list: [{(DQ <v>)}]
                  action: [(C {<viewall>})]
                  spids: [221 224 227 -1]
                )
              ]
            )
          ]
        )
    )
    (C {<shift>} 
      {
        (word_part.ArithSub
          anode: 
            (arith_expr.Binary
              op_id: Id.Arith_Minus
              left: {($ Id.VSub_DollarName '$OPTIND')}
              right: {<Id.Lit_Digits 1>}
            )
        )
      }
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Number '$1'))} 
                  {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ )} {<Id.Lit_RBracket ']'>}
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:newname)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [267]
                )
              ]
            )
          ]
          spids: [247 264]
        )
      ]
    )
    (command.ForEach
      iter_name: hca
      iter_words: [
        {
          (command_sub
            left_token: <Id.Left_Backtick '`'>
            child: (C {<ls>} {($ Id.VSub_DollarName '$ib_sysfs')})
          )
        }
      ]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {<-f>} 
                          {($ Id.VSub_DollarName '$ib_sysfs') <'/'> ($ Id.VSub_DollarName '$hca') 
                            <'/node_desc'>
                          } {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [{<echo>} {<-n>} {(DQ ($ Id.VSub_DollarName '$newname'))}]
                      redirects: [
                        (redir
                          op: <Id.Redir_DGreat '>>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: 
                            {($ Id.VSub_DollarName '$ib_sysfs') <'/'> ($ Id.VSub_DollarName '$hca') 
                              <'/node_desc'>
                            }
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  spids: [293 307]
                )
              ]
              else_action: [
                (C {<logger>} {<-s>} 
                  {(DQ <'Failed to set node_desc for : '> ($ Id.VSub_DollarName '$hca'))}
                )
              ]
            )
          ]
        )
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
  ]
)