(command.CommandList
  children: [
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '$#')} {<-eq>} {<0>} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:thedate)
                  op: assign_op.Equal
                  rhs: {(DQ <today>)}
                  spids: [33]
                )
              ]
            )
          ]
          spids: [16 30]
        )
      ]
      else_action: [
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:mon)
              op: assign_op.Equal
              rhs: 
                {
                  (DQ 
                    (command_sub
                      left_token: <Id.Left_DollarParen '$('>
                      child: 
                        (command.Pipeline
                          children: [
                            (C {<echo>} {($ Id.VSub_Number '$1')})
                            (C {<cut>} {<'-d/'>} {<-f1>})
                          ]
                          negated: F
                        )
                    )
                  )
                }
              spids: [45]
            )
          ]
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:day)
              op: assign_op.Equal
              rhs: 
                {
                  (DQ 
                    (command_sub
                      left_token: <Id.Left_DollarParen '$('>
                      child: 
                        (command.Pipeline
                          children: [
                            (C {<echo>} {($ Id.VSub_Number '$1')})
                            (C {<cut>} {<'-d/'>} {<-f2>})
                          ]
                          negated: F
                        )
                    )
                  )
                }
              spids: [63]
            )
          ]
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:year)
              op: assign_op.Equal
              rhs: 
                {
                  (DQ 
                    (command_sub
                      left_token: <Id.Left_DollarParen '$('>
                      child: 
                        (command.Pipeline
                          children: [
                            (C {<echo>} {($ Id.VSub_Number '$1')})
                            (C {<cut>} {<'-d/'>} {<-f3>})
                          ]
                          negated: F
                        )
                    )
                  )
                }
              spids: [81]
            )
          ]
        )
        (command.If
          arms: [
            (if_arm
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$year'))} {<-o>} 
                          {<-z>} {(DQ ($ Id.VSub_DollarName '$day'))} {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              action: [
                (C {<echo>} {(DQ <'Error: only valid date format is MM/DD/YYYY'>)})
                (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
              ]
              spids: [100 122]
            )
          ]
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:thedate)
              op: assign_op.Equal
              rhs: {(DQ ($ Id.VSub_Number '$1'))}
              spids: [154]
            )
          ]
        )
      ]
    )
    (C {<echo>} {<checking>} {<moon>} {<phase>} {<Id.KW_For for>} {<day>} {<Id.Lit_Equals '='>} 
      {($ Id.VSub_DollarName '$thedate')}
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:url)
          op: assign_op.Equal
          rhs: {(DQ <'http://www.moongiant.com/phase/'> ($ Id.VSub_DollarName '$thedate'))}
          spids: [182]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:pattern)
          op: assign_op.Equal
          rhs: {(DQ <'Illumination:'>)}
          spids: [188]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:phase)
          op: assign_op.Equal
          rhs: 
            {
              (DQ 
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (command.Pipeline
                      children: [
                        (C {<curl>} {<-s>} {(DQ ($ Id.VSub_DollarName '$url'))})
                        (C {<grep>} {(DQ ($ Id.VSub_DollarName '$pattern'))})
                        (C {<tr>} {(SQ <','>)} {(SQ <'\\\n'>)})
                        (C {<grep>} {(DQ ($ Id.VSub_DollarName '$pattern'))})
                        (C {<sed>} {(SQ <'s/[^0-9]//g'>)})
                      ]
                      negated: F
                    )
                )
              )
            }
          spids: [194]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$thedate'))} 
                      {<Id.Lit_Equals '='>} {(DQ <today>)} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [(C {<echo>} {(DQ <'Today the moon is '> (${ Id.VSub_Name phase) <'% illuminated.'>)})]
          spids: [249 267]
        )
      ]
      else_action: [
        (C {<echo>} 
          {
            (DQ <'On '> ($ Id.VSub_DollarName '$thedate') <' the moon = '> (${ Id.VSub_Name phase) 
              <'% illuminated.'>
            )
          }
        )
      ]
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
  ]
)