On Mon 23 Jun 2008 at 16:14:51 -0400, James Vega wrote:
> On Mon, Jun 23, 2008 at 09:47:15PM +0200, Rhialto wrote:
> > 
> > On Tue 17 Jun 2008 at 10:44:50 -0400, James Vega wrote:
> > > I have to agree with Chip here that the upstream version should default
> > > to Bourne as that is most likely to cause people to actually configure
> > > the highlighting to work properly for the variant of /bin/sh that *they*
> > > are using.
> > 
> > But the current Bourne shell *is* a POSIX shell.
> 
> You're thinking of the Bourne-Again SHell (aka bash).  I'm referring to
> the actual Bourne shell, which isn't obsolete yet.

No, I'm not. On the BSDs for instance, /bin/sh is not bash nor ksh nor
ash nor dash, but it *is* a POSIX shell. For the simple reason that
currenent Unixen ought to be POSIX compliant.

I have appended a few fragments from sh(1) at the end.
Or see
http://www.freebsd.org/cgi/man.cgi?query=sh&apropos=0&sektion=0&manpath=FreeBSD+7.0-RELEASE&format=html
for historical manpages of FreeBSD and other BSDs. Even 4.4BSD Lite2
already mentions $() and $(()). In 4.3BSD Net/2 sh is ash and the
manpage mentions $() but not $(()).

> I'll also reiterate that the current default has a purpose in being
> annoyingly wrong in how it syntax highlights the code people using
> modern systems are writing.  It forces you to choose what the correct
> syntax highlighting is when there is no other clear indication what
> shell you are coding towards.

I totally agree with that. I very much dislike the mentality (that I'd
like to call the "Linux mentality", much like the older "all the world
is a VAX mentality") of "if it works on my machine it must be ok".

But on current Unixen, sh is POSIX, and has been for many years, simply
because Unix itself is POSIX.  I would think that on most currently
installed systems this is true, and certainly on all new installations.
Well, Solaris is an exception.


SH(1)                   NetBSD General Commands Manual                   SH(1)

NAME
     sh -- command interpreter (shell)

SYNOPSIS
     sh [-aCefnuvxIimqVEb] [+aCefnuvxIimqVEb] [-o option_name]
        [+o option_name] [command_file [argument ...]]
     sh -c [-aCefnuvxIimqVEb] [+aCefnuvxIimqVEb] [-o option_name]
        [+o option_name] command_string [command_name [argument ...]]
     sh -s [-aCefnuvxIimqVEb] [+aCefnuvxIimqVEb] [-o option_name]
        [+o option_name] [argument ...]

DESCRIPTION
     sh is the standard command interpreter for the system.  The current ver-
     sion of sh is in the process of being changed to conform with the POSIX
     1003.2 and 1003.2a specifications for the shell.  This version has many
     features which make it appear similar in some respects to the Korn shell,
     but it is not a Korn shell clone (see ksh(1)).  Only features designated
     by POSIX, plus a few Berkeley extensions, are being incorporated into
     this shell.  This man page is not intended to be a tutorial or a complete
     specification of the shell.

...
   Command Substitution
     Command substitution allows the output of a command to be substituted in
     place of the command name itself.  Command substitution occurs when the
     command is enclosed as follows:

           $(command)

     or (``backquoted'' version):

           `command`

     The shell expands the command substitution by executing command in a sub-
     shell environment and replacing the command substitution with the stan-
     dard output of the command, removing sequences of one or more <newline>s
     at the end of the substitution.  (Embedded <newline>s before the end of
     the output are not removed; however, during field splitting, they may be
     translated into <space>s, depending on the value of IFS and quoting that
     is in effect.)

   Arithmetic Expansion
     Arithmetic expansion provides a mechanism for evaluating an arithmetic
     expression and substituting its value.  The format for arithmetic expan-
     sion is as follows:

           $((expression))

     The expression is treated as if it were in double-quotes, except that a
     double-quote inside the expression is not treated specially.  The shell
     expands all tokens in the expression for parameter expansion, command
     substitution, and quote removal.

     Next, the shell treats this as an arithmetic expression and substitutes
     the value of the expression.

     Arithmetic expressions use a syntax similar to that of the C language,
     and are evaluated using the `intmax_t' data type (this is an extension to
     POSIX, which requires only `long' arithmetic).  Shell variables may be
     referenced by name inside an arithmetic expression, without needing a
     ``$'' sign.

> James
-Olaf.
-- 
___ Olaf 'Rhialto' Seibert      -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl        -- Cetero censeo "authored" delendum esse.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui