From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <87skeym7vp.fsf@marvin.902northland.adams.home> References: <607df9c5c6c2c916c613568fe50fcc27@quanstro.net> <87skeym7vp.fsf@marvin.902northland.adams.home> Date: Mon, 7 Sep 2009 22:23:51 -0600 Message-ID: <14ec7b180909072123h7a7361e2qa42ad86c2f79ede8@mail.gmail.com> From: andrey mirtchovski 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] Installer error (not supposed to happen) Topicbox-Message-UUID: 6a0b49ea-ead5-11e9-9d60-3106f5b1d025 > % test -f /dev/sdC0/plan9 =C2=A0 =C2=A0 =C2=A0 # produces no errors > % test -f /dev/sdC1/plan9 =C2=A0 =C2=A0 =C2=A0 # produces no errors > > As soon as I put a wildcard into the test string, e.g., > > % test -f /dev/sd*/plan9 > test: unexpected operator/operand: /dev/sdC1/plan9 > > > Hope this helps - thanks! > > Matt the error message you're getting shows up only when test has been given an argument it doesn't understand. furthermore, the bad argument must be the a single character after the first dash (i.e., "test -[sdkfjsdlfkj" won't trip it, but "test -[ lskdfjlkj" will; notice the space in the second example). note also that all subsequent arguments after the second are ignored in the case of -f (test -f /one /two will happily verify that /one is a file, but not bother about /two) now, there are not too many chars that test can't interpret, but '/' is one of them. i'm venturing the possibility that somehow during a raw input at the console some backspaces escaped into the name of the first partition, enough so that after it's interpreted by the shell and then executed it wipes out the "f" in -f. a simple way to trigger: t.c: #include #include void main() { char c =3D 0x8; write(1, &c, 1); write(1, &c, 1); } b.rc: #!/bin/rc var=3D`{8.out} echo test -f $var /dev/sdC1/plan9 % b.rc test - /dev/sdC1/plan9 % note that for this convoluted case to occur you need to interpret the backspaces through a console input. i'm sorry for the noise if this is too far off. andrey