(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:tid)
          op: Equal
          rhs: {(DQ ('simple agent test'))}
          spids: [7]
        )
      ]
      spids: [7]
    )
    (SimpleCommand
      words: [{(${ VSub_Name SSHADD)} {(-l)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[22])
        (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[26])
      ]
      more_env: [(env_pair name:SSH_AUTH_SOCK val:{(/nonexistent)} spids:[13])]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_QMark '$?')} {(-ne)} {(2)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [(C {(fail)} {(DQ ('ssh-add -l did not fail with exit code 2'))})]
          spids: [-1 42]
        )
      ]
      spids: [-1 51]
    )
    (C {(trace)} {(DQ ('start agent'))})
    (SimpleCommand
      words: [
        {(eval)}
        {
          (CommandSubPart
            command_list: (CommandList children:[(C {(${ VSub_Name SSHAGENT)} {(-s)})])
            left_token: <Left_Backtick '`'>
            spids: [62 68]
          )
        }
      ]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[70])]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:r) op:Equal rhs:{($ VSub_QMark '$?')} spids:[74])]
      spids: [74]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$r')} {(-ne)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [(C {(fail)} {(DQ ('could not start ssh-agent: exit code ') ($ VSub_Name '$r'))})]
          spids: [-1 90]
        )
      ]
      else_action: [
        (SimpleCommand
          words: [{(${ VSub_Name SSHADD)} {(-l)}]
          redirects: [
            (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[109])
            (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[113])
          ]
        )
        (If
          arms: [
            (if_arm
              cond: [
                (Sentence
                  child: (C {(Lit_Other '[')} {($ VSub_QMark '$?')} {(-ne)} {(1)} {(Lit_Other ']')})
                  terminator: <Op_Semi ';'>
                )
              ]
              action: [(C {(fail)} {(DQ ('ssh-add -l did not fail with exit code 1'))})]
              spids: [-1 130]
            )
          ]
          spids: [-1 140]
        )
        (C {(trace)} {(DQ ('overwrite authorized keys'))})
        (SimpleCommand
          words: [{(printf)} {(SQ )}]
          redirects: [
            (Redir
              op_id: Redir_Great
              fd: -1
              arg_word: {($ VSub_Name '$OBJ') (/authorized_keys_) ($ VSub_Name '$USER')}
              spids: [155]
            )
          ]
        )
        (ForEach
          iter_name: t
          iter_words: [{(${ VSub_Name SSH_KEYTYPES)}]
          do_arg_iter: False
          body: 
            (DoGroup
              children: [
                (C {(rm)} {(-f)} {($ VSub_Name '$OBJ') (/) ($ VSub_Name '$t') (-agent)})
                (AndOr
                  children: [
                    (C {(${ VSub_Name SSHKEYGEN)} {(-q)} {(-N)} {(SQ )} {(-t)} {($ VSub_Name '$t')} {(-f)} 
                      {($ VSub_Name '$OBJ') (/) ($ VSub_Name '$t') (-agent)}
                    )
                    (C {(fail)} {(DQ ('ssh-keygen for ') ($ VSub_Name '$t') ('-agent failed'))})
                  ]
                  op_id: Op_DPipe
                )
                (SimpleCommand
                  words: [{(cat)} {($ VSub_Name '$OBJ') (/) ($ VSub_Name '$t') (-agent.pub)}]
                  redirects: [
                    (Redir
                      op_id: Redir_DGreat
                      fd: -1
                      arg_word: {($ VSub_Name '$OBJ') (/authorized_keys_) ($ VSub_Name '$USER')}
                      spids: [235]
                    )
                  ]
                )
                (SimpleCommand
                  words: [
                    {(${ VSub_Name SSHADD)}
                    {($ VSub_Name '$OBJ') (/) ($ VSub_Name '$t') (-agent)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {(/dev/null)}
                      spids: [255]
                    )
                    (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[259])
                  ]
                )
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (C {(Lit_Other '[')} {($ VSub_QMark '$?')} {(-ne)} {(0)} {(Lit_Other ']')})
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [(C {(fail)} {(DQ ('ssh-add did succeed exit code 0'))})]
                      spids: [-1 276]
                    )
                  ]
                  spids: [-1 286]
                )
              ]
              spids: [173 289]
            )
          spids: [167 171]
        )
        (SimpleCommand
          words: [{(${ VSub_Name SSHADD)} {(-l)}]
          redirects: [
            (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[298])
            (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[302])
          ]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:r) op:Equal rhs:{($ VSub_QMark '$?')} spids:[306])]
          spids: [306]
        )
        (If
          arms: [
            (if_arm
              cond: [
                (Sentence
                  child: (C {(Lit_Other '[')} {($ VSub_Name '$r')} {(-ne)} {(0)} {(Lit_Other ']')})
                  terminator: <Op_Semi ';'>
                )
              ]
              action: [(C {(fail)} {(DQ ('ssh-add -l failed: exit code ') ($ VSub_Name '$r'))})]
              spids: [-1 323]
            )
          ]
          spids: [-1 334]
        )
        (SimpleCommand
          words: [{(${ VSub_Name SSHADD)} {(-L)}]
          redirects: [
            (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[347])
            (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[351])
          ]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:r) op:Equal rhs:{($ VSub_QMark '$?')} spids:[355])]
          spids: [355]
        )
        (If
          arms: [
            (if_arm
              cond: [
                (Sentence
                  child: (C {(Lit_Other '[')} {($ VSub_Name '$r')} {(-ne)} {(0)} {(Lit_Other ']')})
                  terminator: <Op_Semi ';'>
                )
              ]
              action: [(C {(fail)} {(DQ ('ssh-add -L failed: exit code ') ($ VSub_Name '$r'))})]
              spids: [-1 372]
            )
          ]
          spids: [-1 383]
        )
        (C {(trace)} {(DQ ('simple connect via agent'))})
        (ForEach
          iter_name: p
          iter_words: [{(${ VSub_Name SSH_PROTOCOLS)}]
          do_arg_iter: False
          body: 
            (DoGroup
              children: [
                (C {(${ VSub_Name SSH)} {(-) ($ VSub_Name '$p')} {(-F)} 
                  {($ VSub_Name '$OBJ') (/ssh_proxy)} {(somehost)} {(exit)} {(5) ($ VSub_Name '$p')}
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:r)
                      op: Equal
                      rhs: {($ VSub_QMark '$?')}
                      spids: [428]
                    )
                  ]
                  spids: [428]
                )
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (C {(Lit_Other '[')} {($ VSub_Name '$r')} {(-ne)} {(5) ($ VSub_Name '$p')} 
                              {(Lit_Other ']')}
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (C {(fail)} 
                          {
                            (DQ ('ssh connect with protocol ') ($ VSub_Name '$p') 
                              (' failed (exit code ') ($ VSub_Name '$r') (')')
                            )
                          }
                        )
                      ]
                      spids: [-1 446]
                    )
                  ]
                  spids: [-1 460]
                )
              ]
              spids: [405 463]
            )
          spids: [399 403]
        )
        (C {(trace)} {(DQ ('agent forwarding'))})
        (ForEach
          iter_name: p
          iter_words: [{(${ VSub_Name SSH_PROTOCOLS)}]
          do_arg_iter: False
          body: 
            (DoGroup
              children: [
                (SimpleCommand
                  words: [
                    {(${ VSub_Name SSH)}
                    {(-A)}
                    {(-) ($ VSub_Name '$p')}
                    {(-F)}
                    {($ VSub_Name '$OBJ') (/ssh_proxy)}
                    {(somehost)}
                    {(${ VSub_Name SSHADD)}
                    {(-l)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {(/dev/null)}
                      spids: [510]
                    )
                    (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[514])
                  ]
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:r)
                      op: Equal
                      rhs: {($ VSub_QMark '$?')}
                      spids: [518]
                    )
                  ]
                  spids: [518]
                )
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (C {(Lit_Other '[')} {($ VSub_Name '$r')} {(-ne)} {(0)} {(Lit_Other ']')})
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (C {(fail)} 
                          {
                            (DQ ('ssh-add -l via agent fwd proto ') ($ VSub_Name '$p') 
                              (' failed (exit code ') ($ VSub_Name '$r') (')')
                            )
                          }
                        )
                      ]
                      spids: [-1 535]
                    )
                  ]
                  spids: [-1 549]
                )
                (C {(${ VSub_Name SSH)} {(-A)} {(-) ($ VSub_Name '$p')} {(-F)} 
                  {($ VSub_Name '$OBJ') (/ssh_proxy)} {(somehost)} 
                  {
                    (DQ (${ VSub_Name SSH) (' -') ($ VSub_Name '$p') (' -F ') ($ VSub_Name '$OBJ') 
                      ('/ssh_proxy somehost exit 5') ($ VSub_Name '$p')
                    )
                  }
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:r)
                      op: Equal
                      rhs: {($ VSub_QMark '$?')}
                      spids: [583]
                    )
                  ]
                  spids: [583]
                )
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (C {(Lit_Other '[')} {($ VSub_Name '$r')} {(-ne)} {(5) ($ VSub_Name '$p')} 
                              {(Lit_Other ']')}
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (C {(fail)} 
                          {
                            (DQ ('agent fwd proto ') ($ VSub_Name '$p') (' failed (exit code ') 
                              ($ VSub_Name '$r') (')')
                            )
                          }
                        )
                      ]
                      spids: [-1 601]
                    )
                  ]
                  spids: [-1 615]
                )
              ]
              spids: [485 618]
            )
          spids: [479 483]
        )
        (C {(trace)} {(DQ ('delete all agent keys'))})
        (SimpleCommand
          words: [{(${ VSub_Name SSHADD)} {(-D)}]
          redirects: [
            (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[635])
            (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[639])
          ]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:r) op:Equal rhs:{($ VSub_QMark '$?')} spids:[643])]
          spids: [643]
        )
        (If
          arms: [
            (if_arm
              cond: [
                (Sentence
                  child: (C {(Lit_Other '[')} {($ VSub_Name '$r')} {(-ne)} {(0)} {(Lit_Other ']')})
                  terminator: <Op_Semi ';'>
                )
              ]
              action: [(C {(fail)} {(DQ ('ssh-add -D failed: exit code ') ($ VSub_Name '$r'))})]
              spids: [-1 660]
            )
          ]
          spids: [-1 671]
        )
        (C {(trace)} {(DQ ('kill agent'))})
        (SimpleCommand
          words: [{(${ VSub_Name SSHAGENT)} {(-k)}]
          redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[688])]
        )
      ]
      spids: [100 692]
    )
  ]
)