Re: [9fans] what features would you like in a shell?

2010-10-05 Thread erik quanstrom
On Sun Oct  3 12:11:50 EDT 2010, fors...@vitanuova.com wrote:
 quite typically it's more than a little late, but i was finally able to scan 
 in
 an old RSRE paper that was relevant to the following. the scanning system i 
 had
 at the time couldn't cope.
 
 anyway, it's at
   http://www.vitanuova.com/dist/doc/rsre-3522-curt.pdf

thanks for scanning that.  interesting.  different.

- erik



Re: [9fans] what features would you like in a shell?

2010-10-03 Thread C H Forsyth
quite typically it's more than a little late, but i was finally able to scan in
an old RSRE paper that was relevant to the following. the scanning system i had
at the time couldn't cope.

anyway, it's at
http://www.vitanuova.com/dist/doc/rsre-3522-curt.pdf

-
Newsgroups: comp.os.plan9
From: noagbodjivictor noagbodjivic...@gmail.com
Date: Tue, 31 Mar 2009 15:29:44 GMT
Local: Tues, Mar 31 2009 4:29 pm
Subject: what features would you like in a shell?
Reply to author | Forward | Print | Individual message | Show original | Report 
this message | Find messages by this author
hello, 
I'm a undergrade CS student doing a project for my introductory 
operating systems class. my team wants to write a simple shell from  scratch. 
one idea we have found so far is the following. the shell will record 
all the programs it has run. whenever a program goes awry and is 
killed by the kernel. the shell will reload it. 
what do you think of it? 
also, we know there are many many shells out there. and our professor 
would not like us to write from scratch. we wanted because it provides 
much exercise. but we certainly don't know about all the shells out 
there. 
so I'm writing to get your opinions. maybe there are thing that people 
implement themselves but want included in the shell itself? or just 
something they want implemented? 
thanks a lot in advance for your help.



Re: [9fans] what features would you like in a shell?

2009-04-02 Thread LiteStar numnums
If you have to go to this level, wouldn't it be better to have a language
for this? You probably wouldn't want this interactively, prototyping aside.

On Thu, Apr 2, 2009 at 2:41 PM, John Stalker stal...@maths.tcd.ie wrote:

  so I'm writing to get your opinions. maybe there are thing that people
  implement themselves but want included in the shell itself? or just
  something they want implemented?

 What I most often miss in shell programming is a proper type system.
 Bourne basically only has strings.  Rc improves matters slightly with
 lists of strings.  It's still not enough for me.  I make a lot of
 mistakes in shell programming and strict type checking would catch
 most of them.  I'm not sure I would use a strictly typed shell
 exclusively, but I would certainly like to have it available.

 --
 John Stalker
 School of Mathematics
 Trinity College Dublin
 tel +353 1 896 1983
 fax +353 1 896 2282




-- 
And in the Only Prolog programmers will find this funny department:

Q: How many Prolog programmers does it take to change a lightbulb?

A: No.
 -- Ovid

   By cosmic rule, as day yields night, so winter summer, war peace, plenty
famine. All things change. Air penetrates the lump of myrrh, until the
joining bodies die and rise again in smoke called incense.

   Men do not know how that which is drawn in different directions
harmonises with itself. The harmonious structure of the world depends upon
opposite tension like that of the bow and the lyre.

   This universe, which is the same for all, has not been made by any god
or man, but it always has been, is, and will be an ever-living fire,
kindling itself by regular measures and going out by regular measures
-- Heraclitus


Re: [9fans] what features would you like in a shell?

2009-04-01 Thread yy
2009/4/1 matt mattmob...@proweb.co.uk:

 you think the idea of reloading a crashed program is not a good one?
 for example, what if it's a web browser?



 crash reload crash reload crash reload agghh make it stop

 btw. Windows uses this mechanism for running Explorer, as a stop gap to
 fixing it they just made it auto-respawn.



If somebody wants to do such a thing (which all we agree is a bad
idea) you need no new features in the shell, eg:
while() firefox


-- 
- yiyus || JGL .



Re: [9fans] what features would you like in a shell?

2009-04-01 Thread matt



If somebody wants to do such a thing (which all we agree is a bad
idea) you need no new features in the shell, eg:
while() firefox
   

that doesn't permit a clean exit, this does :

fn ff {firefox || ff} ; ff;




Re: [9fans] what features would you like in a shell?

2009-04-01 Thread matt



you think the idea of reloading a crashed program is not a good one?
for example, what if it's a web browser?




crash reload crash reload crash reload agghh make it stop

btw. Windows uses this mechanism for running Explorer, as a stop gap to 
fixing it they just made it auto-respawn.



either way I think it's a unrequired feature for a shell, a user program 
specifically for monitoring process state would be preferred, should it 
be required.




Re: [9fans] what features would you like in a shell?

2009-04-01 Thread Martin Neubauer
* hiro (23h...@googlemail.com) wrote:
 I also use to put a sleep 1 in there.
 

I'm all for minimalism:
while(! firefox) sleep 1



[9fans] what features would you like in a shell?

2009-03-31 Thread noagbodjivictor
hello,

I'm a undergrade CS student doing a project for my introductory
operating systems class. my team wants to write a simple shell from
scratch.

one idea we have found so far is the following. the shell will record
all the programs it has run. whenever a program goes awry and is
killed by the kernel. the shell will reload it.

what do you think of it?

also, we know there are many many shells out there. and our professor
would not like us to write from scratch. we wanted because it provides
much exercise. but we certainly don't know about all the shells out
there.

so I'm writing to get your opinions. maybe there are thing that people
implement themselves but want included in the shell itself? or just
something they want implemented?

thanks a lot in advance for your help.



Re: [9fans] what features would you like in a shell?

2009-03-31 Thread erik quanstrom
On Tue Mar 31 11:37:06 EDT 2009, noagbodjivic...@gmail.com wrote:
 hello,
 
 I'm a undergrade CS student doing a project for my introductory
 operating systems class. my team wants to write a simple shell from
 scratch.
 
 one idea we have found so far is the following. the shell will record
 all the programs it has run. whenever a program goes awry and is
 killed by the kernel. the shell will reload it.

unfortunately, the most common reason for a program to go
arwy is that the program is broken and it will break again when
reloated.

it would be more interesting to explore how a shell in plan 9
could be used to build simple fs.  

rc has a very interesting virtual machine.  it might be interesting
to build a shell with some hooks into its vm.  paul haahr and
byron built a shell with scheme-y internals and exposed them.
interesting, but complicated.

it would be interesting to use something closer to regular expressions
rather than standard shell globbing.  the challenge would be
to avoid gratuitous breakage and yet allow the match operator
to be much more powerful.

these are areas where rc might be improved upon.  however,
as per usual, it was hard to improve on bourne, and it's even
harder to improve on duff.

nevertheless, i learned quite a bit from failing to improve on
rc.

- erik



Re: [9fans] what features would you like in a shell?

2009-03-31 Thread matt
I've not run into many actual problems with rc so it's pretty near 
perfect :


Though as Erik said - regex matches to compliment ~ matching

hash maps : a['name'] = 'glenda'
arithmetic - though with the 80/20 rule, I don't think the bloat is worth it

I tried a write a couple of other ideas but each time it was better to 
spawn awk or some other better tool for the job!








Re: [9fans] what features would you like in a shell?

2009-03-31 Thread rapogue
I'd love to see tab completion at the command line. If there is a way to do it 
in Plan 9, then I haven't figured it out yet. But then I'm a newby to the OS.

- Original Message -
From: noagbodjivictor noagbodjivic...@gmail.com
To: 9fans@9fans.net
Sent: Tue, 31 Mar 2009 11:29:44 -0400 (EDT)
Subject: [9fans] what features would you like in a shell?

hello,

I'm a undergrade CS student doing a project for my introductory
operating systems class. my team wants to write a simple shell from
scratch.

one idea we have found so far is the following. the shell will record
all the programs it has run. whenever a program goes awry and is
killed by the kernel. the shell will reload it.

what do you think of it?

also, we know there are many many shells out there. and our professor
would not like us to write from scratch. we wanted because it provides
much exercise. but we certainly don't know about all the shells out
there.

so I'm writing to get your opinions. maybe there are thing that people
implement themselves but want included in the shell itself? or just
something they want implemented?

thanks a lot in advance for your help.






Re: [9fans] what features would you like in a shell?

2009-03-31 Thread André Günther
Just Ctrl+F and you have completion for the current dir. I think it's  
a pretty easy hack to extend this to /bin


On 31 Mar 2009, at 18:14, rapo...@catt.com wrote:

I'd love to see tab completion at the command line. If there is a  
way to do it in Plan 9, then I haven't figured it out yet. But then  
I'm a newby to the OS.


- Original Message -
From: noagbodjivictor noagbodjivic...@gmail.com
To: 9fans@9fans.net
Sent: Tue, 31 Mar 2009 11:29:44 -0400 (EDT)
Subject: [9fans] what features would you like in a shell?

hello,

I'm a undergrade CS student doing a project for my introductory
operating systems class. my team wants to write a simple shell from
scratch.

one idea we have found so far is the following. the shell will record
all the programs it has run. whenever a program goes awry and is
killed by the kernel. the shell will reload it.

what do you think of it?

also, we know there are many many shells out there. and our professor
would not like us to write from scratch. we wanted because it provides
much exercise. but we certainly don't know about all the shells out
there.

so I'm writing to get your opinions. maybe there are thing that people
implement themselves but want included in the shell itself? or just
something they want implemented?

thanks a lot in advance for your help.








Re: [9fans] what features would you like in a shell?

2009-03-31 Thread erik quanstrom
 I'd love to see tab completion at the command line. If there is a way to do 
 it in Plan 9, then I haven't figured it out yet. But then I'm a newby to the 
 OS.

it's done by rio, not the shell and you use the
insert key, not tab, as god intended.  bash
irritates the heck out of me when it won't let
me type a tab.  it's a gentle reminder that i
should stop wasting time on linux.

- erik



Re: [9fans] what features would you like in a shell?

2009-03-31 Thread erik quanstrom
 I've not run into many actual problems with rc so it's pretty near 
 perfect :

pretty near.

redirection has a few rough points.  dealing with a device
that expects a write then a read like /net/dns is painful.
i can never get the syntax right the first try.
and (hopefully this isn't just my ignorance) i don't know how
to open a fd to a background shell as one would in bourne.

quoting can get a little dicy when combined with here
docs.

 hash maps : a['name'] = 'glenda'
 arithmetic - though with the 80/20 rule, I don't think the bloat is worth it

the shell i worked on had regular lists, not flat
lists like rc.  the problem with this is that suppose
you're in a directory with a.c b.c a.h b.h.  does this
print 2 or 4?

fn x {
echo $#*
}
x *.c *.h
in rc, the answer is obvious.  if you allow regular
lists, then * is either ((a.c b.c) (a.h b.h)) or
(a.c b.c a.h b.h).

perhaps i just missed the obvious.

- erik



Re: [9fans] what features would you like in a shell?

2009-03-31 Thread noagbodjivictor

 it would be interesting to use something closer to regular expressions
 rather than standard shell globbing.  the challenge would be
 to avoid gratuitous breakage and yet allow the match operator
 to be much more powerful.

thanks a lot for the reply. i got my hand of the unix programming
environment by Kernighan and Pike. I don't think we have the
programming skills for implementing a regular expression engine, but
there was a simple solution that measured the difference between the
command the user entered and an existing command.

maybe we should include that one.

you think the idea of reloading a crashed program is not a good one?
for example, what if it's a web browser?



Re: [9fans] what features would you like in a shell?

2009-03-31 Thread erik quanstrom
 it's done by rio, not the shell and you use the
 insert key, not tab, as god intended.  bash

insert ≡ control-f.

- erik



Re: [9fans] what features would you like in a shell?

2009-03-31 Thread erik quanstrom
 thanks a lot for the reply. i got my hand of the unix programming
 environment by Kernighan and Pike. I don't think we have the
 programming skills for implementing a regular expression engine, but

i would recommend against reimplementing regular expressions.
ken is hard to beat; the standard regexp library is what you want.

the trick is going to be thinking hard about how you are going to
deal with some of the mismatches between standard regular expressions
and file names.  for example, you might need to deal with the fact
that '.' is common in file names, but means any character in a regular
expression.  i think this is going to be the cannonical problem:
globregexp
*.[ch]  \.[ch]$
'*' \*  (this problem is easy)

i don't think this one is about writing lots of code.

 you think the idea of reloading a crashed program is not a good one?

i don't like the idea.

 for example, what if it's a web browser?

how do you determine when to relaunch?  how
do you decide that the program is not going to
relaunch?  how do you stop an errant shell from
relaunching and consuming all your resources?

- erik



Re: [9fans] what features would you like in a shell?

2009-03-31 Thread J.R. Mauro
On Tue, Mar 31, 2009 at 11:29 AM, noagbodjivictor
noagbodjivic...@gmail.com wrote:
 hello,

 I'm a undergrade CS student doing a project for my introductory
 operating systems class. my team wants to write a simple shell from
 scratch.

 one idea we have found so far is the following. the shell will record
 all the programs it has run. whenever a program goes awry and is
 killed by the kernel. the shell will reload it.

 what do you think of it?

Bad idea. What if I expect it to die and maybe want to debug it before
running it again? What if the kernel killed it because it was hogging
resources? Respawning something that constantly gets killed will
probably render the machine unusable. What if the program dies really
quickly? The shell could get caught in a very tight loop you can't
interrupt, and the user winds up killing the shell itself and opening
a new one (after getting really aggravated).

I suppose you could make it optional, but then again, why can't the
user just restart the process by hand?


 also, we know there are many many shells out there. and our professor
 would not like us to write from scratch. we wanted because it provides
 much exercise. but we certainly don't know about all the shells out
 there.

 so I'm writing to get your opinions. maybe there are thing that people
 implement themselves but want included in the shell itself? or just
 something they want implemented?

 thanks a lot in advance for your help.





Re: [9fans] what features would you like in a shell?

2009-03-31 Thread michael block
 you think the idea of reloading a crashed program is not a good one?

 i don't like the idea.

 for example, what if it's a web browser?

 how do you determine when to relaunch?  how
 do you decide that the program is not going to
 relaunch?  how do you stop an errant shell from
 relaunching and consuming all your resources?

you could just print out the commands to restart the
program, and the user could select and send it only
if they want to. that's the approach i usually take
when i write an rc script to automate something, but
i want to check what's going to happen before i
let it run



Re: [9fans] what features would you like in a shell?

2009-03-31 Thread Corey
On Tue, 2009-03-31 at 15:29 +, noagbodjivictor wrote:
 
 so I'm writing to get your opinions. maybe there are thing that people
 implement themselves but want included in the shell itself? or just
 something they want implemented?
 
 thanks a lot in advance for your help.
 

A few features I'd like to see in a shell (though they may already
exist):

Simple redirection into jobs, i.e. some_bin  echo data %1, though
really I don't see why job control should be part of the shell as
opposed to its own program, i.e. $id=`{job start some_bin}; echo data
| job $id

Open looped pipelines. This one is kind of weird (and full of potential
problems) a pipeline the which reads its input from its output AND
stdin, and outputs to its input AND stdout. But I think this one can
actually be done with cat, tee, and FIFO's.




Re: [9fans] what features would you like in a shell?

2009-03-31 Thread sqweek
2009/4/1 erik quanstrom quans...@quanstro.net:
 I've not run into many actual problems with rc so it's pretty near
 perfect :

 pretty near.

 redirection has a few rough points.  dealing with a device
 that expects a write then a read like /net/dns is painful.
 i can never get the syntax right the first try.
 and (hopefully this isn't just my ignorance) i don't know how
 to open a fd to a background shell as one would in bourne.

 I haven't sat down and understood the finer points of rc's
redirection yet, but the precedence relationships between   and |
certainly confuse the hell out of me, coming from bourne ;)

 I'd like to see a shell that, when confronted with a pipeline that
looks like foo ... | ... foo, realises input and output are headed
for the same file, and does whatever it needs to do to avoid
clobbering the file before reading it.

 re not reinventing the wheel, you might want to look into the es
shell. I think this is what erik alluded to earlier - I've never used
it myself but I understand it is extremely programmable, to the point
where you can redefine the pipe operator for example.
-sqweek



Re: [9fans] what features would you like in a shell?

2009-03-31 Thread erik quanstrom
  re not reinventing the wheel, you might want to look into the es
 shell. I think this is what erik alluded to earlier - I've never used
 it myself but I understand it is extremely programmable, to the point
 where you can redefine the pipe operator for example.

; %pipe {echo true} 1 0 cat
true
; fn %pipe {echo $* ; $pipe $*}; echo fu | cat
{echo fu} 1 0 {cat}
fu

- erik