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

Welcome back



Harald Hanche-Olsen writes:
> One of several reasons I am asking is that I would like to restart an
> old discussion about whether or not a non-login es should read a
> config file upon startup.  But I would like to take the time to think

I made a minor extension to rc to read .rcrc on -c, providing the
variable $Command with the argument to -c.  This makes xrsh, etc. work
just fine.  This is something that itcsh (or some such) had that is
invaluable in this environment.

I don't run es (though I might someday) so I'm not sure if it has the
moral equivalent, but it was a very minor addition to rc, and I think
well worth it in terms of increased functionality.

../Dave

-----
The following is the first thing in my .rcrc.  If it is a -c call,
then it (if necessary) it sets up a minimum environment, only going
whole-hog if it turns out that the user creates an interactive shell
(i.e. when prompt gets called).  The sed is to turn sh style grouping
into rc style, and is something that I probably never use now.  I
should probably also nuke the _C_ function... someday.
if (! ~ $#Command 0) {
		~ $#prepath 0 && {
		. ./.rc/rcmin
		fn prompt {
				reenv;refn
				fn prompt
		}}
		eval `` () {echo 'fn _C_ {'^$Command'}'|sed -e 's/(/{/g' -e 's/)/}/g'}
		Command= ()
		_C_
		exit
}