(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:logfile)
          op: assign_op.Equal
          rhs: {(DQ (/var/www/wicked/scripts/searchlog.txt))}
          spids: [17]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-f)} {($ Id.VSub_DollarName '$logfile')} 
                  {(Id.Lit_RBracket ']')}
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:35)
            )
          ]
          action: [
            (C {(touch)} {($ Id.VSub_DollarName '$logfile')})
            (C {(chmod)} {(a) (Id.Lit_Other '+') (rw)} {($ Id.VSub_DollarName '$logfile')})
          ]
          spids: [23 37]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {(-w)} {($ Id.VSub_DollarName '$logfile')} 
                  {(Id.Lit_RBracket ']')}
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:66)
            )
          ]
          action: [
            (command.Pipeline
              children: [
                (C {(echo)} 
                  {
                    (DQ 
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:74)
                        command_list: (command.CommandList children:[(C {(date)})])
                      ) (': ') ($ Id.VSub_DollarName '$QUERY_STRING')
                    )
                  }
                )
                (command.Simple
                  words: [{(sed)} {(SQ (Token id:Id.Lit_Chars val:'s/q=//g;s/+/ /g' span_id:86))}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_DGreat val:'>>' span_id:89)
                      fd: -1
                      arg_word: {($ Id.VSub_DollarName '$logfile')}
                    )
                  ]
                )
              ]
              negated: F
            )
          ]
          spids: [56 68]
        )
      ]
    )
    (C {(echo)} 
      {(DQ ('Location: https://duckduckgo.com/html/?') ($ Id.VSub_DollarName '$QUERY_STRING'))}
    )
    (C {(echo)} {(DQ )})
    (command.ControlFlow token:(Token id:Id.ControlFlow_Exit val:exit span_id:109) arg_word:{(0)})
  ]
)