(CommandList
  children: [
    (Case
      to_match: {(DQ ($ VSub_Pound '$#'))}
      arms: [
        (case_arm
          pat_list: [{(3)}]
          action: [
            (Sentence
              child: 
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:user)
                      op: Equal
                      rhs: {(DQ ($ VSub_Number '$1'))}
                      spids: [27]
                    )
                  ]
                  spids: [27]
                )
              terminator: <Op_Semi ';'>
            )
            (Sentence
              child: 
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:group)
                      op: Equal
                      rhs: {(DQ ($ VSub_Number '$2'))}
                      spids: [33]
                    )
                  ]
                  spids: [33]
                )
              terminator: <Op_Semi ';'>
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:home)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$3'))}
                  spids: [39]
                )
              ]
              spids: [39]
            )
          ]
          spids: [24 25 45 16777215]
        )
        (case_arm
          pat_list: [{(Lit_Other '*')}]
          action: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(echo)} {(DQ ('Usage: adduser user group home-dir'))}]
                  redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[56])]
                )
              terminator: <Op_Semi ';'>
            )
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [47 48 16777215 64]
        )
      ]
      spids: [16 22 64]
    )
    (Case
      to_match: 
        {
          (DQ 
            (CommandSubPart
              command_list: (CommandList children:[(C {(id)})])
              left_token: <Left_Backtick '`'>
              spids: [73 75]
            )
          )
        }
      arms: [
        (case_arm pat_list:[{(SQ <'uid=0('>) (Lit_Other '*')}] spids:[81 84 87 16777215])
        (case_arm
          pat_list: [{(Lit_Other '*')}]
          action: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(echo)} {(DQ ('adduser: you must be root to add users'))}]
                  redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[98])]
                )
              terminator: <Op_Semi ';'>
            )
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [89 90 16777215 106]
        )
      ]
      spids: [70 78 106]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:len)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (C {(expr)} {(DQ ($ VSub_Name '$user'))} {(Lit_Other ':')} 
                        {(SQ <'[a-z][a-z0-9]*$'>)}
                      )
                    ]
                  )
                left_token: <Left_Backtick '`'>
                spids: [113 125]
              )
            }
          spids: [112]
        )
      ]
      spids: [112]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$len'))} {(-eq)} {(0)} {(-o)} 
              {(DQ ($ VSub_Name '$len'))} {(-gt)} {(8)} {(Lit_Other ']')}
            )
          ]
          action: [
            (SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ ('adduser: the user name must be alphanumeric and no longer than 8 characters'))
                }
              ]
              redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[156])]
            )
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [16777215 151]
        )
      ]
      spids: [16777215 169]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:len)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (C {(expr)} {(DQ ($ VSub_Name '$group'))} {(Lit_Other ':')} 
                        {(SQ <'[a-z][a-z0-9]*$'>)}
                      )
                    ]
                  )
                left_token: <Left_Backtick '`'>
                spids: [173 185]
              )
            }
          spids: [172]
        )
      ]
      spids: [172]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$len'))} {(-eq)} {(0)} {(-o)} 
              {(DQ ($ VSub_Name '$len'))} {(-gt)} {(8)} {(Lit_Other ']')}
            )
          ]
          action: [
            (SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ 
                    (
'adduser: the group name must be alphanumeric and no longer than 8 characters'
                    )
                  )
                }
              ]
              redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[216])]
            )
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [16777215 211]
        )
      ]
      spids: [16777215 229]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (SimpleCommand
              words: [{(grep)} {(DQ ('^') ($ VSub_Name '$user') (':'))} {(/etc/passwd)}]
              redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[247])]
            )
          ]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ('adduser: user ') ($ VSub_Name '$user') (' already exists'))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[261])]
            )
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [16777215 250]
        )
      ]
      spids: [16777215 269]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:gid)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (C {(sed)} {(-e)} {(DQ ('/^') ($ VSub_Name '$group') (':/!d'))} {(-e)} 
                        {(SQ <'s/^[^:]*:[^:]*:\\\\([^:]*\\\\):.*/\\\\1/'>)} {(/etc/group)}
                      )
                    ]
                  )
                left_token: <Left_Backtick '`'>
                spids: [273 291]
              )
            }
          spids: [272]
        )
      ]
      spids: [272]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (C {(Lit_Other '[')} 
              {
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [
                        (C {(expr)} {(DQ ($ VSub_Name '$gid'))} {(Lit_Other ':')} {(SQ <'[0-9]*$'>)})
                      ]
                    )
                  left_token: <Left_Backtick '`'>
                  spids: [297 309]
                )
              } {(-eq)} {(0)} {(Lit_Other ']')}
            )
          ]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ('adduser: group ') ($ VSub_Name '$group') (' does not exist'))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[328])]
            )
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [16777215 317]
        )
      ]
      spids: [16777215 336]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:uid) op:Equal rhs:{(10)} spids:[342])]
      spids: [342]
    )
    (While
      cond: [
        (SimpleCommand
          words: [{(grep)} {(DQ ('^[^:]*:[^:]*:') ($ VSub_Name '$uid') (':.*'))} {(/etc/passwd)}]
          redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[357])]
        )
      ]
      body: 
        (DoGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:uid)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [(C {(expr)} {($ VSub_Name '$uid')} {(Lit_Other '+')} {(1)})]
                          )
                        left_token: <Left_Backtick '`'>
                        spids: [364 372]
                      )
                    }
                  spids: [363]
                )
              ]
              spids: [363]
            )
          ]
          spids: [360 374]
        )
    )
    (C {(trap)} {(SQ )} {(1)} {(2)} {(3)} {(15)})
    (AndOr
      ops: [Op_DPipe]
      children: [
        (C {(ln)} {(/etc/passwd)} {(/etc/ptmp)})
        (BraceGroup
          children: [
            (C {(echo)} {(DQ ('adduser: password file busy, try again later'))})
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [405]
        )
      ]
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (C {(mkdir)} {(DQ ($ VSub_Name '$home'))})
        (BraceGroup
          children: [
            (C {(rm)} {(-rf)} {(/etc/ptmp)})
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [433]
        )
      ]
    )
    (C {(echo)} {(cpdir)} {(/usr/ast)} {(DQ ($ VSub_Name '$home'))})
    (AndOr
      ops: [Op_DPipe]
      children: [
        (C {(cpdir)} {(/usr/ast)} {(DQ ($ VSub_Name '$home'))})
        (BraceGroup
          children: [
            (C {(rm)} {(-rf)} {(/etc/ptmp)} {(DQ ($ VSub_Name '$home'))})
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [476]
        )
      ]
    )
    (C {(echo)} {(chown)} {(-R)} {($ VSub_Name '$uid') (Lit_Other ':') ($ VSub_Name '$gid')} 
      {(DQ ($ VSub_Name '$home'))}
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (C {(chown)} {(-R)} {($ VSub_Name '$uid') (Lit_Other ':') ($ VSub_Name '$group')} 
          {(DQ ($ VSub_Name '$home'))}
        )
        (BraceGroup
          children: [
            (C {(rm)} {(-rf)} {(/etc/ptmp)} {(DQ ($ VSub_Name '$home'))})
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [528]
        )
      ]
    )
    (If
      arms: [
        (if_arm
          cond: [(C {(Lit_Other '[')} {(-f)} {(/etc/shadow)} {(Lit_Other ']')})]
          action: [
            (C {(echo)} {(DQ ('echo ') ($ VSub_Name '$user') ('::0:0::: >>/etc/shadow'))})
            (AndOr
              ops: [Op_DPipe]
              children: [
                (SimpleCommand
                  words: [{(echo)} {(DQ ($ VSub_Name '$user') ('::0:0:::'))}]
                  redirects: [
                    (Redir
                      op_id: Redir_DGreat
                      fd: 16777215
                      arg_word: {(/etc/shadow)}
                      spids: [581]
                    )
                  ]
                )
                (BraceGroup
                  children: [
                    (C {(rm)} {(-rf)} {(/etc/ptmp)} {(DQ ($ VSub_Name '$home'))})
                    (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
                  ]
                  spids: [586]
                )
              ]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pwd)
                  op: Equal
                  rhs: {(DQ ('##') ($ VSub_Name '$user'))}
                  spids: [608]
                )
              ]
              spids: [608]
            )
          ]
          spids: [16777215 562]
        )
      ]
      else_action: [
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:pwd) op:Equal rhs:{(EmptyPart)} spids:[617])]
          spids: [617]
        )
      ]
      spids: [614 619]
    )
    (C {(echo)} 
      {
        (DQ ('echo ') ($ VSub_Name '$user') (':') ($ VSub_Name '$pwd') (':') ($ VSub_Name '$uid') (':') 
          ($ VSub_Name '$gid') (':') ($ VSub_Name '$user') (':') ($ VSub_Name '$home') (': >>/etc/passwd')
        )
      }
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (SimpleCommand
          words: [
            {(echo)}
            {
              (DQ ($ VSub_Name '$user') (':') ($ VSub_Name '$pwd') (':') ($ VSub_Name '$uid') (':') 
                ($ VSub_Name '$gid') (':') ($ VSub_Name '$user') (':') ($ VSub_Name '$home') (':')
              )
            }
          ]
          redirects: [(Redir op_id:Redir_DGreat fd:16777215 arg_word:{(/etc/passwd)} spids:[660])]
        )
        (BraceGroup
          children: [
            (C {(rm)} {(-rf)} {(/etc/ptmp)} {(DQ ($ VSub_Name '$home'))})
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [665]
        )
      ]
    )
    (AndOr
      ops: [Op_DPipe]
      children: [(C {(rm)} {(/etc/ptmp)}) (ControlFlow token:<ControlFlow_Exit exit>)]
    )
    (C {(echo)} 
      {
        (DQ ('\n') ('The new user ') ($ VSub_Name '$user') 
          (' has been added to the system.  Note that the password,\n') ('full name, and shell may be changed with the commands passwd(1), chfn(1),\n') 
          ('and chsh(1).  The password is now empty, so only console logins are possible.')
        )
      }
    )
    (If
      arms: [
        (if_arm
          cond: [(C {(Lit_Other '[')} {($ VSub_Name '$gid')} {(Lit_Other '=')} {(0)} {(Lit_Other ']')})]
          action: [
            (C {(echo)} 
              {
                (DQ ('Also note that a new operator needs an executable search path (') 
                  (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('PATH) that\n') ('does not contain the current directory (an empty field or ')
                ) (.) (DQ (' in ') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('PATH).'))
              }
            )
          ]
          spids: [16777215 721]
        )
      ]
      spids: [16777215 740]
    )
    (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})
  ]
)