correct • elegant • free

△ △

◅ PS1

Return Status for Exit ▻

assignment syntax

In article <8ej5n7$b4m$>,
Bob Nelson  <> wrote:
>2). If a Bourne-like shell were written to allow an assignment
>    such as...
>        var = 42

Like rc, for example.

>    ...what are some of the potential parsing problems (sans
>    backward compatibility) that would arise?

In Tom Duff's rc, and current versions of the Open Source rc, you have
to quote `=' whenever it doesn't mean shell assignment.

    ; sh configure --prefix=/opt/gnu
    syntax error

Versions that work are:

    ; sh configure '--prefix=/opt/gnu'

    ; sh configure --prefix^'='^/opt/gnu

and, thanks to free careting,

   ; sh configure --prefix'='/opt/gnu

The first (erroneous) form is not ambiguous, but it slightly complicates
the parser (and the manual page!) to accept it.  The Open Source rc may
do so in the near future.

Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

Original headers:

From: (Tim Goodwin)
Subject: Re: assignment syntax
Date: 3 May 2000 10:23:14 +0100
Message-ID: <8eor6o$lu0$>
References: <8ej5n7$b4m$>

△ △

◅ PS1

Return Status for Exit ▻