Currently for /bin/sh scripts, $(command) and $((1+1))
are marked as errors. These constructs are POSIX compliant
and supported by dash and bash at least.
I contend that erroneously warning users away from these valid
constructs is much worse than not flagging them as errors
on the dwindling non POSIX compliant shells.
thanks,
Pádraig.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
On linux /bin/sh is normally linked to /bin/bash or /bin/dash
both of which support the POSIX $(..) and $((..)) syntax
--- sh.vim.orig 2008-06-16 06:38:39.000000000 +0000
+++ sh.vim 2008-06-16 06:47:21.000000000 +0000
@@ -219,18 +219,11 @@
syn region shCommandSub start="`" skip="\\\\\|\\." end="`" [EMAIL PROTECTED]
" $() and $(()): {{{1
-" $(..) is not supported by sh (Bourne shell). However, apparently
-" some systems (HP?) have as their /bin/sh a (link to) Korn shell
-" (ie. Posix compliant shell). /bin/ksh should work for those
-" systems too, however, so the following syntax will flag $(..) as
-" an Error under /bin/sh. By consensus of vimdev'ers!
-if exists("b:is_kornshell") || exists("b:is_bash")
- syn region shCommandSub matchgroup=shCmdSubRegion start="\$(" skip='\\\\\|\\.' end=")" [EMAIL PROTECTED]
- syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" [EMAIL PROTECTED]
- syn match shSkipInitWS contained "^\s\+"
-else
- syn region shCommandSub matchgroup=Error start="\$(" end=")" [EMAIL PROTECTED]
-endif
+" $(..) is not supported by the original Bourne shell,
+" but is Posix compliant and so supported by all contemporary shells
+syn region shCommandSub matchgroup=shCmdSubRegion start="\$(" skip='\\\\\|\\.' end=")" [EMAIL PROTECTED]
+syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" [EMAIL PROTECTED]
+syn match shSkipInitWS contained "^\s\+"
if exists("b:is_bash")
syn cluster shCommandSubList add=bashSpecialVariables,bashStatement