[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Shell update...



I don't know how useful this may be to others out there, but I have made
some modifications to the shell to provide environment variables (currently
only used for PATH), PATH variables (i.e. set up an execution path, etc..),
and execution of a startup script (i.e. I have mine automagically binding
the network).

If you want to jump right in with it - go to
ftp://ftp.frontenac.org/pub/inferno - there are three files in there:

              sh.dis -- goes in the /dis directory
	      env.dis -- goes in the /dis/lib directory
	      ishrc -- goes in the /lib directory
	      
Here are the specifics of the features:

New Command: set [variablename [value] ]

set by itself returns a list of all set variables.  set with just a variable
name currently clears out the specific var.  set with a variable name and a
value sets the named variable to that value.

New Command: unset variablename

Removes the named environment variable.

Note: because of the way that I did the set and unset commands, they must be
the only command on the line, i.e. set | p will not pipe the output of set
to the pager, but rather set the environment variable '|' to 'p'.  I'm
working on fixing that :)

Variable: PATH

Set this variable to a : separated list of directories to search for
executables.  I.e. if I type in:

     set PATH '/usr/dgarcia/bin:/misc/bin'
     
Then, in addition to checking ./ and /dis, the shell will check
/usr/dgarcia/bin and /misc/bin for an executable.  (Unless an absolute path
is specified).  The paths in the path variable are checked BEFORE ./ and
/dis are checked.  If you want those checked first, add them to the path
variable.  Finally, this will still allow you to set subdirs in an
executable name, i.e. if I have /usr/dgarcia/bin/toys and I run toys/council
with the above parth variable - it will be found and run.

I'm looking into what it would take to allow passing of environment
variables to other programs, but I need to delve some more into the module
loading interface methinks.  (i.e.. allow loading of modules with both the
current init prototype, as well as a new one with an extra argument for an
environment variable - or perhaps use some other mechanism - haven't decided
yet).

Startup file: /lib/ishrc

I put this in lib for the moment because I wasn't entirely sure where a good
place for startup scripts.  I have a sample ishrc file on the ftp site with
the new sh.dis.  It looks like:

/dis/bind '#I' /net
/dis/lib/cs
set PATH '/usr/dgarcia/Work:/usr/dgarcia/bin:./'

As soon as I get a chance, I'll post env.m, env.b, and sh.b (containting the
modifications that I made to the origional sh.b) as well for people to rip
apart.

Coming soon - Council, an irc like chat server/client system.

Cheers,
--Dg