9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: andrey mirtchovski <mirtchovski@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Installer error (not supposed to happen)
Date: Mon,  7 Sep 2009 22:23:51 -0600	[thread overview]
Message-ID: <14ec7b180909072123h7a7361e2qa42ad86c2f79ede8@mail.gmail.com> (raw)
In-Reply-To: <87skeym7vp.fsf@marvin.902northland.adams.home>

> % test -f /dev/sdC0/plan9       # produces no errors
> % test -f /dev/sdC1/plan9       # 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 <u.h>
#include <libc.h>
void
main() {
	char c = 0x8;
	write(1, &c, 1);
	write(1, &c, 1);
}

b.rc:
#!/bin/rc

var=`{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



  parent reply	other threads:[~2009-09-08  4:23 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-06 21:00 Matt Adams
2009-09-06 21:45 ` erik quanstrom
2009-09-06 23:23   ` Matt Adams
2009-09-07  1:27     ` erik quanstrom
2009-09-07  2:50       ` Matt Adams
2009-09-07  3:01   ` Matt Adams
2009-09-07 11:23     ` erik quanstrom
2009-09-08  1:51       ` Matt Adams
2009-09-08  1:52       ` Matt Adams
2009-09-08  2:13         ` erik quanstrom
2009-09-08  3:29           ` Matt Adams
2009-09-08  4:03             ` lucio
2009-09-08  4:08               ` erik quanstrom
2009-09-08 17:19               ` Matt Adams
2009-09-08 17:24                 ` erik quanstrom
2009-09-09  1:08                   ` Matt Adams
2009-09-09  7:35                     ` Richard Miller
2009-09-09 14:35                       ` Matt Adams
2009-09-10  5:05                   ` Matt Adams
2009-09-08 17:34                 ` matt
2009-09-08 17:49                   ` erik quanstrom
2009-09-08  4:23             ` andrey mirtchovski [this message]
2009-09-08  4:13 lucio
     [not found] <e6711db833ab6dfc2b48825e19291501@quanstro.net>
2009-09-08  4:32 ` lucio
2009-09-08  5:48   ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14ec7b180909072123h7a7361e2qa42ad86c2f79ede8@mail.gmail.com \
    --to=mirtchovski@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).