<p>It is typical to have something like this in your cshrc file for setting the path:</p>

<pre><code>set path = ( . $otherpath $path )
</code></pre>

<p>but, the path gets duplicated when you source your cshrc file multiple times, how do you prevent the duplication?</p>

<p>EDIT: This is one unclean way of doing it:</p>

<pre><code>set localpaths = ( . $otherpaths )
echo ${path} | egrep -i "$localpaths" &gt;&amp; /dev/null
if ($status != 0) then
    set path = ( . $otherpaths $path )
endif
</code></pre>

I always set my path from scratch in .cshrc.
That is I start off with a basic path, something like:
```
```
set path = (. ~/bin /bin /usr/bin /usr/ucb /usr/bin/X11)
```
```
(depending on the system).
And then do:
```
```
set path = ($otherPath $path)
```
```
to add more stuff