Subject: Re: a shell idea?
To: VaX#n8 <vax@ccwf.cc.utexas.edu>
From: Darren Reed <darrenr@vitruvius.arbld.unimelb.edu.au>
List: current-users
Date: 10/10/1995 00:47:03
In some email I received from VaX#n8, sie wrote:
> 
> I was wondering about this shell idea I had.
> The basic notion came from the fact that path manipulation is difficult.
> For example, it's difficult (but can be done) to do a command like:
>   ``Add this directory iff it's not already in the path''
> or variations like:
>   ``Add this directory iff it [and every parent directory] are protected
>     from writing by anyone but root or bin''
> This would be especially cool if it was one builtin command, IMHO.
> 
> You get the idea.  Is this a useful project?  Mail me any replies,
> I'm a month or two behind on email (ick!)

Last year sometime, I started setting my path like this:
----------------------------
set path=(.)
foreach i ( ~/bin{,/$arch.$os} /bin /sbin /etc /usr/bin /opt/{local,gnu}/bin \
            /usr/{sbin,ccs/bin,ucb,local/{sbin,rcs,bin/{,nn,mh},etc}} \
            /usr/{X11{,R5,R6}/bin,etc} /usr/{games,hosts,acad/acad} \
            /users/public/{scripts,acad_train} /usr/openwin/{bin,demo} )
        if ( -d $i ) then
                set path=($path $i)
                if ($?prompt) echo -n "$i ";
        endif
end
----------------------------
...so it isn't "secure", but is convienient and works.

I think that sort of stuff is better done in .cshrc's, the system one
if need be.  The above worked for NetBSD-sparc/SunOS 4/Solaris2 equally
well (where arch and os are set from uname).

darren