You are not logged in.
Pages: 1
Hi guys,
I've a stupid problem, or it's a bash bug.
Look:
adv@osiris ~ $ su
Password:
osiris # mkdir try
osiris # cd try/
osiris try # cd ..
osiris adv # Ok, I remove my bashrc temporany (root and user):
[adv@osiris ~]$ su
Password:
[root@osiris ]# cd try/
[root@osiris try]# cd ..
[root@osiris adv]# Have you seen?
Why when i got root the directory disappears??
$ bash --version
GNU bash, version 3.2.5(1)-release (i686-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.Strange =
Ideas?
adv.
adv
Offline
Hi adv,
I think that it's not a bug; try with
su -the "-" means login shell
Offline
It seems correct to me. What you are doing is creating a dir called try, logging in as root, changing dir to try/ and stepping up one level in the directory tree. Since you are logged in as root at that time the shell displays the current dir as adv, the home dir of your regular user, rather than ~ as it is not the home dir of root. Correct me if I am wrong on this. Not sure what you mean by:
Why when i got root the directory disappears??
I made it long
as I lacked the time to make it short...
Offline
Hi adv,
I think that it's not a bug; try withsu -the "-" means login shell
Yes, but in this way i'm in /root.
@ndlarsen:
If you look when i got root, directory "adv" disappears..
Now, this is how it would work correctly:
adv@osiris ~ $ su
Password:
osiris adv #But in my computer is this:
adv@osiris ~ $ su
Password:
osiris #Understood? Why this?
adv.
adv
Offline
Actually 'su -' tells su to *not* copy your environment. i.e. start fresh. So, yes, everything that you're seeing makes sense. In other words, you should always 'su -' unless you have a very good reason to preserve something in the regular user environment when becoming root (a very rare case).
Offline
Pages: 1