PATH set but I can't find where!!!!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers PATH set but I can't find where!!!!
# 1  
Old 04-23-2009
PATH set but I can't find where!!!!

Hi,

Can anybody help with this?

When I log into my user account on my box via ssh and then instantly perform an env command I see that my path has been set as follows:

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

My user account uses the ksh shell. In my home directory there is no .kshrc file but there is a .profile file. There is no reference to path in the .profile file.

I have checked the /etc/profile file and there's no specifc path defined in here either just the following mention of PATH:

#ident "@(#)profile 1.18 98/10/03 SMI" /* SVr4.0 1.3 */

# The profile that all logins get before using their own .profile.

trap "" 2 3
export LOGNAME PATH

if [ "$TERM" = "" ]
then


The above doesn't mean much to me - how can you export a PATH that hasn't been set? I really can't find where my path is being set to PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

Any help would be appreciated!

Thanks!
# 2  
Old 04-23-2009
/etc/profile must source another script that sets PATH. What OS and how are users authenticated? - kerberos, what?

what you look for in /etc/profile is:
Code:
.  somefilename

a leading dot with a space after it, unless it's Linux then the word "source" may be where the aforementioned dot now lives.
# 3  
Old 04-23-2009
Why not edit the .profile and add what you need?

Code:
$ > echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin
$ > vi $HOME/.profile
#       They are expected to edit it to meet their own needs.

MAIL=/usr/mail/${LOGNAME:?}

PATH=$PATH:/opt/csw/bin
export PATH
$ > echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/opt/csw/bin

Once you edit the .profile, logout and login and it should be fixed.
# 4  
Old 04-23-2009
Hi,

Many thanks for the response. The whole of the /etc/profile file is below. I can't see it calling another script...

root@server1# more profile
#ident "@(#)profile 1.18 98/10/03 SMI" /* SVr4.0 1.3 */

# The profile that all logins get before using their own .profile.

trap "" 2 3
export LOGNAME PATH

if [ "$TERM" = "" ]
then
if /bin/i386
then
TERM=sun-color
else
TERM=sun
fi
export TERM
fi

# Login and -su shells get /etc/profile services.
# -rsh is given its environment in its .profile.

case "$0" in
-sh | -ksh | -jsh)

if [ ! -f .hushlogin ]
then
/usr/sbin/quota
# Allow the user to break the Message-Of-The-Day only.
trap "trap '' 2" 2
/bin/cat -s /etc/motd
trap "" 2

/bin/mail -E
case $? in
0)
echo "You have new mail."
;;
2)
echo "You have mail."
;;
esac
fi
esac

umask 022
trap 2 3
# 5  
Old 04-23-2009
Quote:
Originally Posted by bassman121
Why not edit the .profile and add what you need?

Code:
$ > echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin
$ > vi $HOME/.profile
#       They are expected to edit it to meet their own needs.

MAIL=/usr/mail/${LOGNAME:?}

PATH=$PATH:/opt/csw/bin
export PATH
$ > echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/opt/csw/bin

Once you edit the .profile, logout and login and it should be fixed.


Hi,

Thanks. Yeah I could do that I'm just intreagued now as I can't find what's setting it and it's annoying me :-)
# 6  
Old 04-23-2009
You didn't indicate what release of Linux/Unix you were using.
Check man pages for pam_login.
some setting may come from /etc/login.defs
# 7  
Old 04-23-2009
Quote:
Originally Posted by sandholm
You didn't indicate what release of Linux/Unix you were using.
Check man pages for pam_login.
some setting may come from /etc/login.defs
Sorry, It's Solaris8. I'll have a look at the man pages for that.

Cheers!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find a file and set path in variable?

Hi Folks - I was wondering if you could help convert batch code in Linux? For instance, I use the following piece of code in DOS to find a file/executable, and then the FULL path as a variable. ::-- If startMaxl.exe exists, set full path --:: for %%D in (c d e f g h i j k l m n o p q r s t... (4 Replies)
Discussion started by: SIMMS7400
4 Replies

2. UNIX for Dummies Questions & Answers

Find commmand returning search path with the result set

OS Platform : Oracle Linux 6.5 We are creating a shell script to purge old log files . It uses find command with rm in it. The syntax is find <Path of Log Directory> -exec rm -fr {} \; Example: find /tmp/test3 -exec rm -fr {} \; For rm command , we use -r option to... (4 Replies)
Discussion started by: kraljic
4 Replies

3. UNIX for Dummies Questions & Answers

Path set

Something changed on my unix box. Now when I log in it is showing entire path. It used to show only $ prompt before. I know I need to do something in .profile to show only $ prompt Could you please tell me what I should do, to show only $ prompt. (4 Replies)
Discussion started by: raopatwari
4 Replies

4. UNIX for Dummies Questions & Answers

How do I set the path

Very new to this type of thing so go easy on me....... I have downloaded a command language for data display. It came as ncl_ncarg-5.2.1.MacOS_10.6_i386_64bit_gcc421.tar.gz and I unzipped/tarred it into my local directory. The new directory, ncl_ncarg-5.2.1.MacOS_10.6_i386_64bit_gcc421,... (7 Replies)
Discussion started by: davcra
7 Replies

5. Solaris

How to set path for a command

Hi all, I am trying ping command in SUN v240 server but it is not working but when i am using the full path /usr/sbin/ping <ip address> then it is working. how to set the path of ping command so that by simply typing ping <ip address> it should work ? Plz help me out:( (7 Replies)
Discussion started by: saurabh84g
7 Replies

6. Solaris

Not Able to Set the path

Hi, I want to set the path for my application so I am setting the path as below -- PATH=${PATH}:.:/envs/mldev/tools:/envs/mldev/common/tools:${HOME}:/bin/p4v:/usr/j2se:/usr/j2se/bin:/usr/j2se/lib or PATH="\ /usr/bin:\ /usr/sbin:\ /usr/dt/bin:\ ... (7 Replies)
Discussion started by: smartgupta
7 Replies

7. UNIX for Dummies Questions & Answers

Set java Path

Hey eveyone, I am new to unix, and I just installed java 6, however it doesn't recognize javac command I tried to set the path such as: set path="/usr/java/jdk1.6.0_06/bin/ but i still got the same error message. any ideas? -andi (1 Reply)
Discussion started by: adtd8
1 Replies

8. Solaris

set path

hi how do i change the default PATH in my system. i log in as root, and i have .profile file in my / directory. ive put the PATH=.:/usr.......... statement, but that doesnt seem to be working i also wanted to know why exactly we need the profile file in etc? (6 Replies)
Discussion started by: strider
6 Replies

9. UNIX for Dummies Questions & Answers

Set PATH using a script

I am a corporate user of Solaris ?? I have to write a lot of scripts to do little repetitive actions. To make this easier I would like to set the PATH so that I do not have to type ./ first before the script name. Is there an easy script that will allow me to set this path when I log in??? ... (2 Replies)
Discussion started by: jagannatha
2 Replies

10. UNIX for Dummies Questions & Answers

why the PATH can not be set correctly?

I'm using Linux-Mandrake 8.0 in my laptop. After I logged in as a "root", I added a new path in my .bashrc file (I use bash shell). Then I can observe it has been set correctly by typing echo $PATH. But, when I log in again as a personal account, not "root", then I open my bash shell, and type... (5 Replies)
Discussion started by: yishen
5 Replies
Login or Register to Ask a Question