View Single Post
Old 20th November 2008
richBSD richBSD is offline
New User
Join Date: Nov 2008
Posts: 8
Default root has problems with environment variables

I'm seeing another issue that I think may be related. I've set a custom prompt in .cshrc like this:

if ($?prompt) then
# An interactive shell -- set some stuff up
#set prompt="`whoami`@`hostname -s` $cwd ->" #Custom Prompt settings
set prompt = '%n@%m:%/%# '
set filec
set history = 100
set savehist = 100
set mail = (/var/mail/$USER)
if ( $?tcsh ) then
bindkey "^W" backward-delete-word
bindkey -k up history-search-backward
bindkey -k down history-search-forward

Then I copied the same .cshrc file to the root directory /.
Using either the current prompt or the one in the commented out line above it gives the same results, the prompt changes in the user account when I change directories but not in the root account. The prompt displays the path when I first su in a terminal window but doesn't change after that when I change directories. But it does change when in the user account like this:

root@CubeTest /usr/home ->cd ..
root@CubeTest /usr/home ->pwd
root@CubeTest /usr/home ->exit
Rich@CubeTest:/usr/home> cd ..
Rich@CubeTest:/usr> pwd

It seems like the root account is having trouble seeing the environment variables sometimes. Any clues on what I could check? Also fbsetbg works fine in the user account but still can't find it in the root account. The root account has trouble finding things in the path.
Reply With Quote