From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <0d3820e90fedfa15c374652fe64f06b4@ladd.quanstro.net> <8e04b5820912140715g20e56d31m57bd7e567843d0e4@mail.gmail.com> Date: Mon, 14 Dec 2009 18:33:47 +0200 Message-ID: <8e04b5820912140833m58c575d0x92030d2e7fc1b3ce@mail.gmail.com> From: "Ciprian Dorin, Craciun" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] rc shell UNIX port repository Topicbox-Message-UUID: b02a2112-ead5-11e9-9d60-3106f5b1d025 On Mon, Dec 14, 2009 at 6:14 PM, erik quanstrom wrote= : >> =C2=A0 =C2=A0 One for example (I think it is a bug, but maybe in the sem= antics >> you've described it's not): >> =C2=A0 =C2=A0 * again if we're using `-e`, and inside a function we writ= e `fn >> dosomething { echo 1 ; false ; echo 2 ; return 0 ; }` >> =C2=A0 =C2=A0 * if we run `dosomething` it shall output only `1`, as the= false >> breaks the execution; >> =C2=A0 =C2=A0 * but if we run `dosomething || echo 3`, we see `1 2` outp= uted, >> because the false is not exiting the shell as the invocation of the >> function is part of a `||` statement; > > not a bug. =C2=A0x || y is "line" in the rc grammar. =C2=A0"x;" is als o = a line. > -e is only evaluated at the end of lines. I see... (But I keep my opinion about the overly-complex `-e` semantics= ...) >> =C2=A0 =C2=A0 But undoubtedly, the following is a bug (I have an array a= nd want >> to display all the elements on a single line, wrapped inside quotes, >> and everything with a prefix and a suffix): > [...] > >> ifs=3D'\n' echo ' =C2=A0erl files =3D ('^`{ echo -n >> '`'^$application__erl_files__short^'`' }^')' >> ifs=3D'\n' echo ' =C2=A0erl files =3D ('^`{ echo -n >> '`'^$application__erl_files__long^'`' }^')' >> ~~~~ >> =C2=A0 =C2=A0 it displays: >> ~~~~ >> =C2=A0 erl files =3D (`a.erl` `b.erl` `c.erl`) >> =C2=A0 erl files =3D (`/home/cipria) =C2=A0 erl files =3D (/workbe) =C2= =A0 erl files =3D >> (ch/vel/a.erl` `/home/cipria) =C2=A0 erl files =3D (/workbe) =C2=A0 erl = files =3D >> (ch/vel/b.erl` `/home/cipria) =C2=A0 erl files =3D (/workbe) =C2=A0 erl = files =3D >> (ch/vel/c.erl`) >> ~~~~ > > not a bug. =C2=A0you set the ifs to '\' and 'n'. =C2=A0since the first > list doesn't have any ns in it, it doesn't get split. > to get a newline in rc you need > ifs=3D' > ' cmd > > - erik ???? So then how can I say on the same line ifs=3D<> ???? (I know about the actual newline between the quotes, but I think it's a very ugly syntax, especially when it involves indentation...)