(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:LOCALEDIR)
          op: Equal
          rhs: {(/usr/share/locale)}
          spids: [22]
        )
      ]
      spids: [22]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(KW_Bang '!') (Lit_Other '=')} {(DQ )} 
                  {(Lit_Other ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:LOCALEDIR)
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                  spids: [46]
                )
              ]
              spids: [46]
            )
          ]
          spids: [-1 43]
        )
      ]
      spids: [-1 49]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-x)} {(./localeck)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [(C {(echo)} {(DQ ('ERROR: build test program first.'))}) (C {(exit)} {(1)})]
          spids: [-1 65]
        )
      ]
      spids: [-1 79]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:PATH_LOCALE)
          op: Equal
          rhs: {($ VSub_Name '$LOCALEDIR')}
          spids: [82]
        )
      ]
      spids: [82]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:LOCALES) op:Equal rhs:{(0)} spids:[85])]
      spids: [85]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:ERRORS) op:Equal rhs:{(0)} spids:[88])]
      spids: [88]
    )
    (C {(echo)} {(DQ ('Validating locales in ') ($ VSub_Name '$LOCALEDIR'))})
    (C {(echo)})
    (ForEach
      iter_name: i
      iter_words: [
        {
          (CommandSubPart
            command_list: (CommandList children:[(C {(ls)} {(-1)} {($ VSub_Name '$LOCALEDIR')})])
            left_token: <Left_Backtick '`'>
            spids: [108 114]
          )
        }
      ]
      do_arg_iter: False
      body: 
        (DoGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:LOCALES)
                  op: Equal
                  rhs: 
                    {
                      (ArithSubPart
                        anode: 
                          (ArithBinary
                            op_id: Arith_Plus
                            left: (ArithWord w:{($ VSub_Name '$LOCALES')})
                            right: (ArithWord w:{(Lit_Digits 1)})
                          )
                        spids: [120 127]
                      )
                    }
                  spids: [119]
                )
              ]
              spids: [119]
            )
            (AndOr
              children: [
                (C {(./localeck)} {($ VSub_Name '$i')})
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:ERRORS)
                      op: Equal
                      rhs: 
                        {
                          (ArithSubPart
                            anode: 
                              (ArithBinary
                                op_id: Arith_Plus
                                left: (ArithWord w:{($ VSub_Name '$ERRORS')})
                                right: (ArithWord w:{(Lit_Digits 1)})
                              )
                            spids: [137 144]
                          )
                        }
                      spids: [136]
                    )
                  ]
                  spids: [136]
                )
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [116 146]
        )
      spids: [107 -1]
    )
    (C {(echo)})
    (C {(echo)} {(DQ ('Validation test complete'))})
    (C {(echo)} {(DQ ($ VSub_Name '$LOCALES') (' locales were checked'))})
    (C {(echo)} {(DQ ($ VSub_Name '$ERRORS') (' invalid locales were found'))})
  ]
)