On linux /bin/sh is normally linked to /bin/bash or /bin/dash both of which support the POSIX $(..) and $((..)) syntax. The patch below is wrong really. The correct fix is to default the is_posix variable to 1. Others disagree however :( http://groups.google.com/group/vim_dev/t/41139a32772b2f5f --- 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="`" contains=@shCommandSubList " $() 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=")" contains=@shCommandSubList - syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shCommandSubList - syn match shSkipInitWS contained "^\s\+" -else - syn region shCommandSub matchgroup=Error start="\$(" end=")" contains=@shCommandSubList -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=")" contains=@shCommandSubList +syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shCommandSubList +syn match shSkipInitWS contained "^\s\+" if exists("b:is_bash") syn cluster shCommandSubList add=bashSpecialVariables,bashStatement