[PATCH v2 1/1] syntax-highlight: when the file has no extension, assume text
Ferry Huberts
mailings at hupie.com
Thu Apr 5 12:04:58 CEST 2012
On 05-04-12 11:38, Christian Franke wrote:
> On 04/04/2012 07:07 PM, Ferry Huberts wrote:
>> On 04-04-12 18:58, Lukas Fleischer wrote:
>>> There is no "==" in POSIX shell/test(1). This should probably be a
>>> single equal sign ("=").
>
>> it appears there is, or (if there is not) the line above also doesn't
>> work (that line has been in since 56522eb, 19-11-2009)
>
> $ cat<< EOF> test.sh
> if [ "magic" == "\$1" ]; then
> echo "Argument is magic."
> fi
> EOF
> $ /bin/dash test.sh
> [: 3: magic: unexpected operator
> $ /bin/dash test.sh magic
> [: 3: magic: unexpected operator
> $ sed -e 's/==/=/' -i test.sh
> $ /bin/dash test.sh
> $ /bin/dash test.sh magic
> Argument is magic.
> $ /bin/bash test.sh
> $ /bin/bash test.sh magic
> Argument is magic.
>
> dash is a posix compatible shell. As most people use bash as their
> shell, incompatibilies with posix shell often go unnoticed for a long
> time. A script should however either specify /bin/bash as interpreter
> or adhere to the shell language given in POSIX.
>
> Best Regards,
> Christian
ok, thanks for the demo
I'll post a follow-up patch that fixes the POSIX issues
--
Ferry Huberts
More information about the CGit
mailing list