On 16/06/08 14:59, Pádraig Brady wrote: > Charles E. Campbell, Jr. wrote: >> Pádraig Brady wrote: >> >>> 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. >>> >>> >> Read :help ft-sh-syntax , in particular lines 2419-2435 . FYI -- >> bash is not "dwindling". > > You misunderstand I think. Obviously bash is not dwindling :) > $() is OK for bash, dash, ash, ... > It's only not OK for old Borne shells. > > Therefore I think we should not flag this POSIX syntax > as an error by default for all /bin/sh scripts. > > thanks, > Pádraig.
#!/bin/sh scripts are supposed to be for sh (the "old Bourne shell"), not bash or ksh. If you want them to be highlighted as bash scripts, then replace #!/bin/sh by #!/bin/bash. Quoting lines 2431 to 2435 of syntax.txt: > If there's no "#! ..." line, and the user hasn't availed himself/herself of a > default sh.vim syntax setting as just shown, then syntax/sh.vim will assume > the Bourne shell syntax. No need to quote RFCs or market penetration > statistics in error reports, please -- just select the default version of the > sh your system uses in your <.vimrc>. Best regards, Tony. -- We don't know who discovered water, but we're certain it wasn't a fish. --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
