* [9fans] debugging rc
@ 2011-07-05 7:31 Rudolf Sykora
2011-07-05 7:46 ` dexen deVries
0 siblings, 1 reply; 3+ messages in thread
From: Rudolf Sykora @ 2011-07-05 7:31 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
Hello all,
yesterday I wanted to try out rc-httpd on p9p&linux. There, in an rc
script was sth along the following lines:
file = aaanamebb
a = name
if(~ $file *$a*) echo y
and the script returned
rc: null list in concatenation
I wrote to the author that I believe he should have written *$a^* in
the condition.
Nonetheless I have 2 questions:
1) if *$a* is left there, is the meaning really: whatever_non_blank +
contents of $a + literal * ?
2) it took me some time to localize where the problem was since the
only output of the script was what I wrote above; so I went commenting
& uncommenting... Is there any better way? Can rc be told to give some
more helpful info?
Thanks
Ruda
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [9fans] debugging rc
2011-07-05 7:31 [9fans] debugging rc Rudolf Sykora
@ 2011-07-05 7:46 ` dexen deVries
2011-07-05 12:16 ` erik quanstrom
0 siblings, 1 reply; 3+ messages in thread
From: dexen deVries @ 2011-07-05 7:46 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
On Tuesday 05 of July 2011 09:31:43 Rudolf Sykora wrote:
> (...)
> Is there any better way? Can rc be told to give some
> more helpful info?
there are:
flag x +
flag r +
the output produced by r + is somewhat strange, but may be good enough. In your case, it shows difference between *$a* and *$a^*:
the former is:
Xdol (a*) () ()
Xmark () ()
Xword () () ()
Xconc (*) () ()
rc: null list in concatenation
(guess `Xdol (a*)' means `dereference variable a*' (preasumably empty), which is in turn Xconc()atenated with literal `*' and thus the error)
the later is
Xdol (a) () () (*) ()
Xmark (name) () (*) ()
Xword () (name) () (*) ()
Xconc (*) (name) () (*) ()
Xconc (*name) (*) ()
--
dexen deVries
[[[↓][→]]]
For example, if the first thing in the file is:
<?kzy irefvba="1.0" rapbqvat="ebg13"?>
an XML parser will recognize that the document is stored in the traditional ROT13 encoding.
(( Joe English, http://www.flightlab.com/~joe/sgml/faq-not.txt ))
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [9fans] debugging rc
2011-07-05 7:46 ` dexen deVries
@ 2011-07-05 12:16 ` erik quanstrom
0 siblings, 0 replies; 3+ messages in thread
From: erik quanstrom @ 2011-07-05 12:16 UTC (permalink / raw)
To: 9fans
> On Tuesday 05 of July 2011 09:31:43 Rudolf Sykora wrote:
> > (...)
> > Is there any better way? Can rc be told to give some
> > more helpful info?
>
> there are:
> flag x +
> flag r +
>
> the output produced by r + is somewhat strange, but may be good enough. In your case, it shows difference between *$a* and *$a^*:
>
> the former is:
>
> Xdol (a*) () ()
> Xmark () ()
> Xword () () ()
> Xconc (*) () ()
> rc: null list in concatenation
this is a trace of the rc virtual machine. it's not easy to follow, or
helpful in most cases.
if the problem is the null list in concatination, i made a small change
to rc to give more information about these problems in the error
message on steve's suggestion.
this version of rc is available as quanstro/futharc or on the 9atom
cd.
- erik
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-07-05 12:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-05 7:31 [9fans] debugging rc Rudolf Sykora
2011-07-05 7:46 ` dexen deVries
2011-07-05 12:16 ` erik quanstrom
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).