On 26/03/2018 11:34, Martijn Dekker wrote:
Op 25-03-18 om 22:56 schreef Harald van Dijk:
   case /dev in $pat) echo why ;; esac

Now, bash and dash say that the pattern does match -- they take the
backslash as unquoted, allowing it to escape the v. Most other shells
(bosh, ksh93, mksh, pdksh, posh, yash, zsh) still take the backslash as

This doesn't make sense to me, and doesn't match historic practice:

With the snipping it's not clear that I was specifically confused by the inconsistency.

I had included another example:

  printf "%s\n" $pat

I can understand treating backslash as quoted, or treating it as unquoted, but not quoted-unless-in-a-case-statement. What justifies this one exception?

Harald van Dijk
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to