From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <2967C352-8607-44E6-87FA-DB94B18688DC@icloud.com> References: <2967C352-8607-44E6-87FA-DB94B18688DC@icloud.com> Date: Wed, 15 Jul 2015 17:41:31 +0200 Message-ID: From: dexen deVries To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a11c26586f480fd051aebc96b Subject: Re: [9fans] Acme 2-1 chord arguments Topicbox-Message-UUID: 604cb386-ead9-11e9-9d60-3106f5b1d025 --001a11c26586f480fd051aebc96b Content-Type: text/plain; charset=UTF-8 dirty 1.) rc -c 'git '^ note the space after git idiomatic 1.) use win(1), pass 'command' argument a script which executes git for each line of input as arguments through rc(1) to evaluate the arguments in the usual way 2.) you can pass complex regular expression as argument to grep(1), without rc(1) choking on metacharacters. the argument is guaranteed not to have unforeseen side effects. example win(1) script: #!/usr/bin/env rc orig_ifs = $ifs PAGER=cat while (true) { ifs='' echo -n 'git> ' line = `{read} ifs = $orig_ifs rc -c 'git '^ $line } --001a11c26586f480fd051aebc96b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
dirty 1.) rc -c 'git '^=C2=A0
note the sp= ace after git

idiomatic 1.) use win(1), pass 'command'= argument a script which executes git for each line of input as arguments t= hrough rc(1) to evaluate the arguments in the usual way

2.) you can pass complex regular expression as argument to grep(1), with= out rc(1) choking on metacharacters.
the argument is guarante= ed not to have unforeseen side effects.


example win(1= ) script:
#!/usr/bin/env rc

orig_ifs =3D $ifs

PAGER=3Dcat<= br>
while (true) {
=C2=A0=C2=A0=C2=A0 ifs=3D''
=C2=A0=C2= =A0=C2=A0 echo -n 'git> '
=C2=A0=C2=A0=C2=A0 line =3D `{read}=
=C2=A0=C2=A0=C2=A0 ifs =3D $orig_ifs
=C2=A0=C2=A0=C2=A0 rc -c 'g= it '^ $line
}

--001a11c26586f480fd051aebc96b--