9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] string to list?
@ 2001-06-10 11:14 Matt
  2001-06-10 14:46 ` Boyd Roberts
  2001-06-10 15:20 ` andrey mirtchovski
  0 siblings, 2 replies; 19+ messages in thread
From: Matt @ 2001-06-10 11:14 UTC (permalink / raw)
  To: 9fans

Hi,

list to string is documented :
list=(How now brown cow)
string=$"list

but how do I go the other way?

specifically I'm want to parse IRC messages with RC

given
:Matt!~matt@hostname.com PRIVMSG #[s.i.s.] :some text

I want to turn it into

$nick $host $msgtype $channel $msg

can someone bash me with the cluestick please.

Matt


---
AVG Scanned for viruses
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.261 / Virus Database: 131 - Release Date: 07/06/2001



^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <vikki@proweb.co.uk>]
* Re: [9fans] string to list?
@ 2001-06-10 22:36 Jonathan Sergent
  2001-06-11  0:15 ` Matt
  2001-06-11 10:18 ` Laura Creighton
  0 siblings, 2 replies; 19+ messages in thread
From: Jonathan Sergent @ 2001-06-10 22:36 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 172 bytes --]

Doesn't the availability of '#s' (i.e.  '#s'/boot) break this (unless
you are in group noworld)?

What's wrong with words=(`{echo $line}) and then switch($words(1))?


[-- Attachment #2: Type: message/rfc822, Size: 2337 bytes --]

From: "Matt" <matt@proweb.co.uk>
To: <9fans@cse.psu.edu>
Subject: Re: [9fans] string to list?
Date: Sun, 10 Jun 2001 22:48:51 +0100
Message-ID: <002501c0f1f7$235fa220$6401a8c0@freeze2k>


----- Original Message -----
From: "Scott Schwartz" <schwartz@bio.cse.psu.edu>


> | I plan to have it do eval `{$msg} and do whatever it's
> | namespace will let it.
>
> I really wouldn't do that.  It's just too unpredictable and dangerous.
> eval considered harmful.

being as I've not implemented it my understanding is weak but I thought that
I could dictate the namespace that a process sees. If the total namespace
the ircbot process sees is

/
/bin/opme
/bin/cat
/bin/ls
/bin/eval
/bin/echo
/slashdotheadlines

then all ircbot can do is  combinations like
echo eval 'ls /bin'
echo eval 'opme'
echo eval 'cat /slashdotheadlines'

but because it can't bind new files in or import them it can't manipulate
it's namespace via the eval







^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [9fans] string to list?
@ 2001-06-10 23:22 presotto
  2001-06-10 23:35 ` Scott Schwartz
  0 siblings, 1 reply; 19+ messages in thread
From: presotto @ 2001-06-10 23:22 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 140 bytes --]

You can turn off access to all '#' devices except #{|decp}.  Look
at RFNOMNT on rfork.  I believe 'rfork m' in rc does an rfork(RFNOMNT).

[-- Attachment #2: Type: message/rfc822, Size: 3991 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 172 bytes --]

Doesn't the availability of '#s' (i.e.  '#s'/boot) break this (unless
you are in group noworld)?

What's wrong with words=(`{echo $line}) and then switch($words(1))?


[-- Attachment #2.1.2: Type: message/rfc822, Size: 2337 bytes --]

From: "Matt" <matt@proweb.co.uk>
To: <9fans@cse.psu.edu>
Subject: Re: [9fans] string to list?
Date: Sun, 10 Jun 2001 22:48:51 +0100
Message-ID: <002501c0f1f7$235fa220$6401a8c0@freeze2k>


----- Original Message -----
From: "Scott Schwartz" <schwartz@bio.cse.psu.edu>


> | I plan to have it do eval `{$msg} and do whatever it's
> | namespace will let it.
>
> I really wouldn't do that.  It's just too unpredictable and dangerous.
> eval considered harmful.

being as I've not implemented it my understanding is weak but I thought that
I could dictate the namespace that a process sees. If the total namespace
the ircbot process sees is

/
/bin/opme
/bin/cat
/bin/ls
/bin/eval
/bin/echo
/slashdotheadlines

then all ircbot can do is  combinations like
echo eval 'ls /bin'
echo eval 'opme'
echo eval 'cat /slashdotheadlines'

but because it can't bind new files in or import them it can't manipulate
it's namespace via the eval







^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [9fans] string to list?
@ 2001-06-11  1:45 presotto
  0 siblings, 0 replies; 19+ messages in thread
From: presotto @ 2001-06-11  1:45 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 585 bytes --]

Turning off the ability to use pipes and the environment means you
pretty much can't run any programs.  Turning of the ability to
open /dev/fd doesn't really save anything since you can always
dup.

The only ones that are really a problem are devproc and devcons.  They
are used for access to notes and to console i/o.  They were left
on since devcons protects itself, only the host owner can do anything
important, and devproc needs to be linked in anyways so that stuff
like notes works.  Access to devproc needs to be rethought.  I'm not sure the
right semantics though.

[-- Attachment #2: Type: message/rfc822, Size: 1528 bytes --]

From: Scott Schwartz <schwartz@bio.cse.psu.edu>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] string to list?
Date: Sun, 10 Jun 2001 19:35:27 -0400
Message-ID: <20010610233528.26933.qmail@g.bio.cse.psu.edu>

| You can turn off access to all '#' devices except #{|decp}.  Look
| at RFNOMNT on rfork.  I believe 'rfork m' in rc does an rfork(RFNOMNT).

The manpage doesn't mention those exceptions.  Why can't you turn off
access to them too?  

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2001-06-11 10:38 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-10 11:14 [9fans] string to list? Matt
2001-06-10 14:46 ` Boyd Roberts
2001-06-10 21:01   ` Matt
2001-06-10 21:09     ` Boyd Roberts
2001-06-10 15:20 ` andrey mirtchovski
     [not found] <vikki@proweb.co.uk>
2001-06-10 17:32 ` vikki
2001-06-10 17:47   ` Boyd Roberts
2001-06-10 17:55   ` Boyd Roberts
2001-06-10 18:03   ` Scott Schwartz
2001-06-10 21:48     ` Matt
2001-06-10 22:24       ` Scott Schwartz
2001-06-10 22:30         ` Boyd Roberts
2001-06-10 22:36 Jonathan Sergent
2001-06-11  0:15 ` Matt
2001-06-11 10:18 ` Laura Creighton
2001-06-11 10:38   ` Matt
2001-06-10 23:22 presotto
2001-06-10 23:35 ` Scott Schwartz
2001-06-11  1:45 presotto

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).