Bojan Land wrote: > Is what I am describing a bug, or lack of understanding?
I am not sure. I read through your posting very carefully but was not quite sure what you were asking. Could we on the mailing list have more information? > There are three examples here. If executable file is in cwd and path > points to cwd and if the same file is referenced bash executes a file > that is outside of the cwd! This to me seems quite dangerous, though I > realize it could just be my inexperience with bash. Did you previously reference the file and have that path cached? This would mean that you would need to tell bash to discard the hash and to rehash everything. hash -r > [EMAIL PROTECTED] bin]$ which mycmd > /bin/mycmd The which command is a standalone program (sometimes csh, sometimes bash, sometimes other things). It will never have a hashed path. Better to use 'type' in this case. type mycmd What does bash say the type of mycmd is? I think it is previously hashed to /bin/mycmd and that after that point in your shell that you added the local ./mycmd. If you started up a fresh shell it would not have been cached there. > BASHBUG2: description or implementation of option P Need more information. > BUGDESC: When P is unset the symlink is still followed, though PS not > updated. > Reference from man: > -P If set, the shell does not follow symbolic links when > executing commands such as cd that change the current > working directory. It uses the physical directory > structure instead. By default, bash follows the logi- > cal chain of directories when performing commands which > change the current directory. What is not clear about the description? Can you suggest an improvement? > lrwxrwxrwx 1 root root 24 Nov 4 2005 public_html -> > /var/www/html_users/user > [EMAIL PROTECTED] user]# set -P > [EMAIL PROTECTED] user]# cd public_html > [EMAIL PROTECTED] user]# pwd > /var/www/html_users/user Looks good. Bash did not track the logical value of how you got there but instead used the actual physical paths. > [EMAIL PROTECTED] user]# cd /home/user > [EMAIL PROTECTED] user]# set +P > [EMAIL PROTECTED] user]# cd public_html > [EMAIL PROTECTED] public_html]# pwd > /home/user/public_html Looks good. Bash remembered that it got there through the path /home/user/public_html even though you are really someplace else entirely. If you 'cd ..' it will back up a directory and you will be back in your /home/user directory. I can tell that there is still something that is not understood about physical and logical paths but I don't know what the misunderstanding is at this point. Need more information. Bob _______________________________________________ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash