: >
: >someone save me from this csh anomoly. How can I shorten the path or make
: >csh accept arbitrarily long paths.
: Try this:
: set npath
: foreach elem ( $path )
: if ( ! -d $elem ) continue
: set needed
: foreach nelem ( $npath )
: if ( $nelem == $elem ) then
: unset needed
: break
: endif
: end
: if ( $?needed ) set npath = ( $npath $elem )
: end
: set path = ( $npath )
: unset npath nelem elem needed
I like this... I have something similar, where you give it
a set of paths and it appends bin, man and info and sets
these paths accordingly...
When I wrote this, after much headbanging, I gave up on the csh...;-)
: Not only will it eliminate duplicate entries, but it will also
: eliminate directories that do not exist. (If you use directory
: elements that are not root based, you'll want to remove the line
: "if ( ! -d $elem ) continue".)
: --
: James C. Armstrong, Jr. | Scots wha hae wi' Wallace bled,
: URL: | Or to victory!
: ftp://ftp.netcom.com/pub/jca/homepage.html
--
marty
Member of the League for Programming Freedom
Object techonology is to software what microprocessors are to
hardware.
Phillipe Kahn