[BUG] dash doesn't report syntax error when it should on stray "fi"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



How to reproduce:

  $ dash -c ':; fi'; echo stat = $?
  stat = 0

Behaviour of other shells:

  $ bash-4.1 -c ':; fi'; echo stat = $?  # Bash 4.1.5
  bash-4.1: -c: line 0: syntax error near unexpected token `fi'
  bash-4.1: -c: line 0: `:; fi'
  stat = 1

  $ bash-3.2 -c ':; fi'; echo stat = $? # Bash 3.2.0
  bash-3.2: -c: line 0: syntax error near unexpected token `fi'
  bash-3.2: -c: line 0: `:; fi'
  stat = 2

  $ ksh -c ':; fi'; echo stat = $? # AT&T Ksh
  ksh: syntax error at line 1: `fi' unexpected
  stat = 3

  $ pdksh -c ':; fi'; echo stat = $? # Public Domain Ksh, version 5.2.14
  pdksh: syntax error: `fi' unexpected
  stat = 1

  $ zsh -c ':; fi'; echo stat = $?  # Zsh 4.3.12
  zsh:1: parse error near `fi'
  stat = 1


Version information:

  $ dpkg -l dash
  ii   dash   0.5.5.1-7.4   POSIX-compliant shell

Regards,
  Stefano
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux