From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <3850801494679010@web30j.yandex.ru> References: <3850801494679010@web30j.yandex.ru> From: Charles Forsyth Date: Sun, 14 May 2017 10:56:01 +0100 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary="001a1140298c3de1d1054f78f211" Subject: Re: [9fans] equality sign in Rc Topicbox-Message-UUID: bcc8cd3e-ead9-11e9-9d60-3106f5b1d025 --001a1140298c3de1d1054f78f211 Content-Type: text/plain; charset="UTF-8" On 13 May 2017 at 13:36, trebol wrote: > You can force rc to setting a variable only if = is surrounded by spaces, > like in sh, but then you'll have a lot of problems in plan9/p9p. That isn't sh's rule. x=y is fine as an assignment without spaces. Shell/environment variable assignments appear only before a command, as in rc, and otherwise the text gets passed to the command. As I understood Bourne's talk about sh, originally it was intended to support named parameters, as in another command interpreter he'd used, and in cmd x=y b=x, the shell not the command would parse the x=y and b=x and pass the result to the command separately from the positional parameters of argv. That was modified to be allowed only at the start, because of an existing command 'dd', which unusually used x=y instead of the usual -x y, partly as humour, since IBM JCL then and now had a DD statement with name=value syntax (//STEP5.INPUT DD DSNAME=FRUITBAT,DISP=SHR) ``The maximum number of DD statements per job step is 3273''. Plan 9's dd's syntax changed to the -x y style. In rc, the unquoted = causes a syntax error because nothing in syn.y allows '=' after the start of . Perhaps instead of passing it to the command as in Unix, rc could do what sh originally intended, and lift named parameters into the environment wherever they appear in a command. --001a1140298c3de1d1054f78f211 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

= On 13 May 2017 at 13:36, trebol <trebol55555@yandex.ru> = wrote:
You can force r= c to setting a variable only if =3D is surrounded by spaces, like in sh, bu= t then you'll have a lot of problems in plan9/p9p.
That isn't sh's rule. x=3Dy is fine as an assignment without spac= es. Shell/environment variable assignments appear only before a command, as= in rc,
and otherwise the text gets passed = to the command. As I understood Bourne's talk about sh, originally it w= as intended to support named
parameters, as= in another command interpreter he'd used, and in cmd x=3Dy b=3Dx, the = shell not the command would parse the x=3Dy and b=3Dx
and pass the result to the command separately from the positiona= l parameters of argv. That was modified to be allowed only at the start,
because of an existing command 'dd', = which unusually used x=3Dy instead of the usual -x y, partly as humour, sin= ce IBM JCL then and now
had a DD statement = with name=3Dvalue syntax (//STEP5.INPUT DD DSNAME=3DFRUITBAT,DISP=3DSHR)
``The maximum number of DD statements per job= step is 3273''. Plan 9's dd's syntax changed to the -x y s= tyle.

= In rc, the unquoted =3D causes a syntax error because nothing in syn.y allo= ws '=3D' after the start of <simple>.
Perhaps instead of passing it to the command as in Unix, rc could = do what sh originally intended, and lift named parameters
into the environment wherever they appear in a command.
--001a1140298c3de1d1054f78f211--