(command.CommandList
  children: [
    (C {(Id.KW_Set set)} {(-o)} {(nounset)})
    (C {(Id.KW_Set set)} {(-o)} {(pipefail)})
    (C {(Id.KW_Set set)} {(-o)} {(errexit)})
    (command.ShFunction
      name: log
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [{(echo)} {(DQ ($ Id.VSub_At '$@'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'1>&' span_id:45)
                  fd: 1
                  arg_word: {(2)}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: versioned-dest
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Id.Lit_VarLike 'branch=') 
                (command_sub
                  left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:61)
                  command_list: 
                    (command.CommandList
                      children: [(C {(git)} {(rev-parse)} {(--abbrev-ref)} {(HEAD)})]
                    )
                )
              }
            )
            (C {(log)} {(DQ ('branch ') ($ Id.VSub_DollarName '$branch'))})
            (C {(local)} 
              {(Id.Lit_VarLike 'hash=') 
                (command_sub
                  left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:83)
                  command_list: 
                    (command.CommandList
                      children: [(C {(git)} {(rev-parse)} {($ Id.VSub_DollarName '$branch')})]
                    )
                )
              }
            )
            (C {(local)} 
              {(Id.Lit_VarLike 'short_hash=') 
                (braced_var_sub
                  token: (Token id:Id.VSub_Name val:hash span_id:96)
                  suffix_op: 
                    (suffix_op.Slice
                      begin: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)})
                      length: (arith_expr.ArithWord w:{(Id.Lit_Digits 8)})
                    )
                )
              }
            )
            (C {(log)} {(DQ ('hash ') ($ Id.VSub_DollarName '$short_hash'))})
            (C {(local)} 
              {(Id.Lit_VarLike 'dest=') 
                (DQ (oilshell.org/git-branch/) ($ Id.VSub_DollarName '$branch') (/) 
                  ($ Id.VSub_DollarName '$short_hash')
                )
              }
            )
            (C {(echo)} {($ Id.VSub_DollarName '$dest')})
          ]
        )
    )
    (command.ShFunction
      name: spec
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(Id.Lit_VarLike 'user=') ($ Id.VSub_Number '$1')})
            (C {(local)} {(Id.Lit_VarLike 'host=') ($ Id.VSub_Number '$2')})
            (C {(local)} {(dest)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:dest)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:162)
                          command_list: (command.CommandList children:[(C {(versioned-dest)})])
                        ) (/) 
                        (command_sub
                          left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:166)
                          command_list: (command.CommandList children:[(C {(hostname)})])
                        ) (/spec)
                      )
                    }
                  spids: [160]
                )
              ]
            )
            (C {(ssh)} 
              {($ Id.VSub_DollarName '$user') (Id.Lit_Other '@') ($ Id.VSub_DollarName '$host')} {(mkdir)} {(-p)} {($ Id.VSub_DollarName '$dest')}
            )
            (C {(rsync)} {(--archive)} {(--verbose)} {(--copy-links)} {(_tmp/spec/)} 
              {($ Id.VSub_DollarName '$user') (Id.Lit_Other '@') ($ Id.VSub_DollarName '$host') 
                (Id.Lit_Other ':') ($ Id.VSub_DollarName '$dest') (/)
              }
            )
            (C {(echo)} {(DQ ('Visit http://') ($ Id.VSub_DollarName '$dest') (/RESULTS.html))})
          ]
        )
    )
    (command.ShFunction
      name: unit
      body: 
        (command.BraceGroup
          children: [(C {(echo)} {(SQ (Token id:Id.Lit_Chars val:'Hello from publish.sh' span_id:245))})]
        )
    )
    (command.ShFunction
      name: wild
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(Id.Lit_VarLike 'user=') ($ Id.VSub_Number '$1')})
            (C {(local)} {(Id.Lit_VarLike 'host=') ($ Id.VSub_Number '$2')})
            (C {(local)} {(dest)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:dest)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:284)
                          command_list: (command.CommandList children:[(C {(versioned-dest)})])
                        )
                      )
                    }
                  spids: [282]
                )
              ]
            )
            (C {(ssh)} 
              {($ Id.VSub_DollarName '$user') (Id.Lit_Other '@') ($ Id.VSub_DollarName '$host')} {(mkdir)} {(-p)} {($ Id.VSub_DollarName '$dest')}
            )
            (C {(rsync)} {(--archive)} {(--verbose)} {(_release/VERSION/test/wild.wwz)} 
              {($ Id.VSub_DollarName '$user') (Id.Lit_Other '@') ($ Id.VSub_DollarName '$host') 
                (Id.Lit_Other ':') ($ Id.VSub_DollarName '$dest') (/)
              }
            )
            (C {(echo)} {(DQ ('Visit http://') ($ Id.VSub_DollarName '$dest') (/wild.wwz/))})
          ]
        )
    )
    (C {(DQ ($ Id.VSub_At '$@'))})
  ]
)