Operating System - HP-UX
1755747 Members
3036 Online
108837 Solutions
New Discussion юеВ

how to add variables into this file?.cshrc profile.

 
SOLVED
Go to solution
Manuales
Super Advisor

how to add variables into this file?.cshrc profile.

Hi,
my user is user1 using SHELL=/usr/bin/csh
i want to run online
. /home/user2/env/environment.sh

but the result is:
serverunix 2: . /home/user2/env/environment.sh/usr/bin/.: Permission denied.

how could i enable to use ". /home/user2/env/environment.sh" (.)

the profile .cshrc contains:

========================================

# Default user .cshrc file (/usr/bin/csh initialization).
#
# @(#)B.11.11_LR
# Usage: Copy this file to a user's home directory and edit it to
# customize it to taste. It is run by csh each time it starts up.

# Set up default command search path:
#
# (For security, this default is a minimal set.)

set path=( $path )

# Set up C shell environment:

if ( $?prompt ) then # shell is interactive.
set history=20 # previous commands to remember.
set savehist=20 # number to save across sessions.
set system=`hostname` # name of this system.
set prompt = "$system \!: " # command prompt.

# Sample alias:

alias h history

# More sample aliases, commented out by default:

# alias d dirs
# alias pd pushd
# alias pd2 pushd +2
# alias po popd
# alias m more
endif
============================================

also ..how can i add new variables ..
i tried to add (connect direct processes):
set MANPATH=$MANPATH:home/user3/cdunix/ndm/man1
set NDMAPICFG=/home/user3/cdunix/ndm/cfg/cliapi/ndmapi.cfg
but it did not work...

how can i change the kind of profile into .cshrc ???... i know i have to do that into /etc/passwd file, but i do not have access there .. please let me know the answer of these 3 questions.

thanks in advance.
10 REPLIES 10
V. Nyga
Honored Contributor
Solution

Re: how to add variables into this file?.cshrc profile.

Hi,

try:
setenv MANPATH ${MANPATH}:/home/user3/cdunix/ndm/man1

Also:
- there's no '/' before your home/... path.
- why the dot before:
/home/user2/env/environment.sh ?

What does /home/user2/env/environment.sh do?

Have you checked your environment? (with 'env')

Exists:
/home/user2/env/environment.sh/usr/bin/. ?
Do you have permissions?

Volkmar
*** Say 'Thanks' with Kudos ***
Robert-Jan Goossens
Honored Contributor

Re: how to add variables into this file?.cshrc profile.

setenv MANPATH=$MANPATH:home/user3/cdunix/ndm/man1

setenv NDMAPICFG=/home/user3/cdunix/ndm/cfg/cliapi/ndmapi.cfg

The .cshrc is the profile of the c-shell.

You will have to explain a more what mean with
how could i enable to use ". /home/user2/env/environment.sh" (.)
Mike Shilladay
Esteemed Contributor

Re: how to add variables into this file?.cshrc profile.

Hi Manuales,

The first answer is you need to adjust the permissions to be readable by the user, or change the owner of the .profile to the user.

The second answer is:
set path=(:), subsitute the "" for your required path.

the third answer is to change to csh, just type csh at the command prompt.

hope that helps,

Mike.
V. Nyga
Honored Contributor

Re: how to add variables into this file?.cshrc profile.

Sorry RJ,
from 'man csh' setenv is without '='
set can work, too, but as said don't forget the '/'.

V.
*** Say 'Thanks' with Kudos ***
Robert-Jan Goossens
Honored Contributor

Re: how to add variables into this file?.cshrc profile.

eugh... Vo Thanks cut and past error.
Dennis Handly
Acclaimed Contributor

Re: how to add variables into this file?.cshrc profile.

>Robert-Jan: You will have to explain a more what mean with how could i enable to use ". /home/user2/env/environment.sh"

Right. Were you trying to source it in scummy C shell?:
% source home/user2/env/environment.sh
Robert-Jan Goossens
Honored Contributor

Re: how to add variables into this file?.cshrc profile.

Dennis,

look at the last characters, or are these to point at the dot.

". /home/user2/env/environment.sh" (.) <--

0 points please
Dennis Handly
Acclaimed Contributor

Re: how to add variables into this file?.cshrc profile.

>Robert-Jan: look at the last characters, or are these to point at the dot.
". /home/user2/env/environment.sh" (.) <--

That was my assumption. Since the line before it looked like the error message:
. /home/user2/env/environment.sh/usr/bin/.: Permission denied.

Doing this in the scummy C shell would give that error since "." is not a script or a program.
$ csh
% . /usr/bin/echo
/home/MYID/bin/.: Permission denied.

So it is finding the first filename that is "." in $path.
Dennis Handly
Acclaimed Contributor

Re: how to add variables into this file?.cshrc profile.

This thread talks about how to "source" a file in various shells:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1165054