Leo, thank you for your report. I see what you are saying, though it is not entirely accurate. In a basic sudo environment, your user's environment variables remain intact, so ~ still references your home directory. If you entered a sudo-root shell with "sudo -s", you will find that "echo ~" prints your home directory. However, if you use the initial-login switch, "sudo -i", running "echo ~" will print "/root".
I think this note in the docs needs to be removed altogether since it is inaccurate and not really applicable to this specific section of the docs anyway.
Leo, thank you for your report. I see what you are saying, though it is not entirely accurate. In a basic sudo environment, your user's environment variables remain intact, so ~ still references your home directory. If you entered a sudo-root shell with "sudo -s", you will find that "echo ~" prints your home directory. However, if you use the initial-login switch, "sudo -i", running "echo ~" will print "/root".
I think this note in the docs needs to be removed altogether since it is inaccurate and not really applicable to this specific section of the docs anyway.