PATH variable problem

root->echo $PATH
/usr/ccs/bin:/opt/sfw/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin

root->find / -name gcc
/usr/local/bin/gcc
/usr/local/doc/gcc

root->which gcc
no gcc in /usr/sbin /usr/bin

Why cant it find gcc - the path looks okay doesnt it?

I am running solaris 9 - and my shell is csh.
.cshrc file looks like this:
set PATH="/usr/ccs/bin:/opt/sfw/bin:/usr/local/sbin:/usr/local/bin:$PATH"

At first you use syntax which seems to be sh and then state you are running csh. :confused:

Whichever, what does
printenv PATH
say? Are execute permissions set on gcc? With csh try "rehash".

try

export PATH="/usr/ccs/bin:/opt/sfw/bin:/usr/local/sbin:/usr/local/bin:$PATH"
or
setenv PATH="/usr/ccs/bin:/opt/sfw/bin:/usr/local/sbin:/usr/local/bin:$PATH"

No joy...

root->printenv PATH
printenv: Command not found

setenv PATH="/usr/ccs/bin:/opt/sfw/bin:/usr/local/sbin:/usr/local/bin:$PATH"
root->which gcc
no gcc in /usr/sbin /usr/bin

Any other ideas?

Obviously the "which" command is using a different path variable than PATH. I am not an expert in csh (I prefer bash), but I remember reading somewhere that the c-shell had a shell variable path and an environment variable PATH. Just for kicks and giggles, does echo $path give a different response than echo $PATH?

;

Try:
/usr/ucb/printenv PATH
/usr/bin/id
/usr/bin/ps -f
and post the results.

From the CSH man page

           The most commonly used environment
           variables, USER, TERM,  and  PATH,  are  automatically
           imported  to and exported from the csh variables user,
           term, and path; there is no need  to  use  setenv  for
           these. In addition, the shell sets the PWD environment
           variable from the csh variable cwd whenever the latter
           changes.

try the following:

$$> set path = ( /usr/ccs/bin /opt/sfw/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin )
$$> rehash

set path="$path /usr/ccs/bin /opt/sfw/bin /usr/local/sbin /usr/local/bin"

this worked... hmnn I thought the path variable was UPPERCASE..

Anyway - thanks - I was losing the plot altogether...