I'm trying to figure out the logic of my user shell and root shell
This might be best illustrated with an example.
If I log into the linux host I'm using and run the following:
I now run sudo bash to become root and run the same command
So roots path overrides the users path.
However, I thought that if I now run .bash_profile from the users directory:
the users path would override the root path but apparently not as:
it still returns python from the root directory shell.
Is there any way to override this?
I know I should probably be running commands as:
sudo <command> etc but I'm confused as to the logic employed and I haven't been able to clear it up with google searches.
Can anyone outline the logic?
Last edited by pludi; 06-23-2010 at 08:03 AM..
Reason: code tags, please...
You probably want to source /etc/profile, not /home/whatever/... but then it must've gotten sourced in the first place on login anyway.
Just being root doesn't make PATH behave differently as much as root gets a different PATH.
Remember /etc/profile is a script, not dumb list, so may easily do different things depending on what user logs in. On my system there's a ROOTPATH variable in /etc/profile which is copied over PATH for the root user only.
Last edited by Corona688; 06-23-2010 at 11:36 AM..
Hi,
When I login to my HP-UX and fire the "set" command I see that the weblogic 9.2 classpath is already set.
However, I wish to override the classpath to weblogic version 10.3
I have a script call setWLSEnv.sh that has the desired classpath.
Thus, in my unix script i write
.... (6 Replies)
Hi All
After downloading ZFS documentation from oracle site, I am able to successfully migrate UFS root FS without zones to ZFS root FS. But in case of UFS root file system with zones , I am successfully able to migrate global zone to zfs root file system but zone are still in UFS root file... (2 Replies)
Hi,
I get this question in the console when I try to delete a htaccess file. What does it mean ?
override rw-r--r-- root/staff for .htaccess?
thanks (2 Replies)
Hi, yesterday, I changed root's shell in /etc/passwd, cause a mistake then I can not log in root account (can't find correct shell). I attempted to log in single-mode, however, it prompted for single-mode's password then I type root's password but still can not log in.
I'm using AIX 5L version 5.2... (2 Replies)
I would like to override the default profile which is loaded when the system starts or When I run a program so that profile should get loaded in the settings.
Is there any system call to do so.
. (0 Replies)
hi ,
greetings ,
I have one doubt reg the C functions .
I have a program sample.c , in which i have function name scanf , which reads a a variable and prints the variable inside the function .
this scanf is nothing to do with C library function scanf , but i would like to use only user... (1 Reply)
When the aix date function is called by a routine, is the date function 'aware' of the name of the routine that is calling it, such that if we had the source code of the date function, we could modify it so that it provides a date to the caller depending upon the identity of the calling routine.... (1 Reply)
Hi Guys,
I'm new in Unix Environment.
Any Unix Guru around...I need help. My question is, is it possible that the root cron could be override with 3rd party software?How can it happen. Another thing, how the cron job works?, I mean how the Unix process the cron job , I don't have an idea... (2 Replies)
Hi
My computer of late started misbehaving. Whenever I switch it on
It say Override and then it takes long to boot. Surprising is that it opens excel automatic. What could be that? (1 Reply)
I am having this problem......when I run this script:
print -n "Enter file name to be deleted: "
read answer
if
then
rm $name
else
echo "No such file with the name: $name exists"
fi
I was trying to test my script for errors, and basically when the user had files with the rights: 400,... (1 Reply)