On Wed, Mar 28, 2018 at 12:53:31PM +0200, Harald van Dijk wrote:
> I don't think this allows dash's behaviour of taking the backslash as a
> literal, since that still allows a match to succeed. bash lets such a
> pattern never match. In other shells, there is no way to get into this
> situation, but GNU find behaves the same as bash.
Nope, bash treats it as if the backslash is not there.
$ touch asdf\\
$ touch asdf
$ bash -c 'v="../da*sh/asdf\\"; printf "%s\n" $v'
> Test case:
> v=\\; case \\ in $v) echo bug;; esac
> bash prints nothing, dash 0.5.9.1 prints bug. Other shells don't count since
> they interpret $v differently.
Indeed bash seems to do something different for case matches.
Since bash itself is inconsistent, and POSIX unclear, I have opted
to be consistent with existing dash behaviour.
Email: Herbert Xu <herb...@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
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