(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:logfile)
          op: Equal
          rhs: {(DQ (/var/www/wicked/scripts/searchlog.txt))}
          spids: [17]
        )
      ]
      spids: [17]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (C {(Lit_Other '[')} {(KW_Bang '!')} {(-f)} {($ VSub_Name '$logfile')} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(touch)} {($ VSub_Name '$logfile')})
            (C {(chmod)} {(a) (Lit_Other '+') (rw)} {($ VSub_Name '$logfile')})
          ]
          spids: [16777215 37]
        )
      ]
      spids: [16777215 53]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {(-w)} {($ VSub_Name '$logfile')} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Pipeline
              children: [
                (C {(echo)} 
                  {
                    (DQ 
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(date)})])
                        left_token: <Left_CommandSub '$('>
                        spids: [74 76]
                      ) (': ') ($ VSub_Name '$QUERY_STRING')
                    )
                  }
                )
                (SimpleCommand
                  words: [{(sed)} {(SQ <'s/q=//g;s/+/ /g'>)}]
                  redirects: [
                    (Redir
                      op: <Redir_DGreat '>>'>
                      fd: 16777215
                      arg_word: {($ VSub_Name '$logfile')}
                    )
                  ]
                )
              ]
              negated: F
            )
          ]
          spids: [16777215 68]
        )
      ]
      spids: [16777215 93]
    )
    (C {(echo)} {(DQ ('Location: https://duckduckgo.com/html/?') ($ VSub_Name '$QUERY_STRING'))})
    (C {(echo)} {(DQ )})
    (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})
  ]
)