> Except that this solution is not necessarily a stable one. Is it
> guaranteed that . will always be at the end of the path, or could
> something else be eventually tacked on later?
Good point. In fact, application setup scripts (e.g., JDK's) that are
called later in /etc/csh.cshrc *already* add to the path, causing . not to
end up in the very last position.
A more general solution could combine the two cases (and a third, for .
can, in principle, begin a path too) --
set path = (`echo $path | sed 's/^\. //' | sed 's/ \. / /' | sed 's/ \.$//'`)
Anyone see an easy way to do it with one 'sed'?
Shawn