[Bug 1164895] New: cd does not switch to the parent directory
http://bugzilla.suse.com/show_bug.cgi?id=1164895 Bug ID: 1164895 Summary: cd does not switch to the parent directory Classification: openSUSE Product: openSUSE Distribution Version: Leap 15.1 Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Documentation Assignee: fs@suse.com Reporter: giecrilj@stegny.2a.pl QA Contact: fs@suse.com Found By: --- Blocker: --- Contrary to what the documentation says, the command cd does not switch to the parent directory of the current directory. It switches to the directory referred to by a path obtained by stripping the last element of the current directory path (which is not always the path to the current directory). Example: { cd /proc/1/cwd/..; } The parent directory of /proc/1/cwd is / — but the command takes me to /proc/1 instead. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1164895 Christopher Yeleighton <giecrilj@stegny.2a.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- URL| |https://doc.opensuse.org/do | |cumentation/leap/startup/ht | |ml/book.opensuse.startup/ch | |a-new-bash.html#sec-new-bas | |h-commands-help Hardware|Other |x86-64 Found By|--- |Community User OS|Other |Windows 10 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1164895 http://bugzilla.suse.com/show_bug.cgi?id=1164895#c1 Christopher Yeleighton <giecrilj@stegny.2a.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugzilla.suse.com/s | |how_bug.cgi?id=1089619 --- Comment #1 from Christopher Yeleighton <giecrilj@stegny.2a.pl> --- In other words, assuming you are in /proc/1/cwd, the following instructions are not equivalent: * { cd ../mnt; } * { cd .. && cd mnt; } -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1164895 Christopher Yeleighton <giecrilj@stegny.2a.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- URL|https://doc.opensuse.org/do |https://doc.opensuse.org/do |cumentation/leap/startup/ht |cumentation/leap/startup/ht |ml/book.opensuse.startup/ch |ml/book.opensuse.startup/ch |a-new-bash.html#sec-new-bas |a-new-bash.html#sec-new-bas |h-commands-help |h-fildir -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1164895 http://bugzilla.suse.com/show_bug.cgi?id=1164895#c4 Frank Sundermeyer <fs@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |WONTFIX --- Comment #4 from Frank Sundermeyer <fs@suse.com> --- That sounds a bit like splitting hairs to me, because it depends on the definition of current path. Given the command names that exist to show paths I would argue that current path==working directory which differs from the real path:
cd /var/run/ pwd /var/run realpath . /run
the result of "cd -P .." is probably the behavior you expect, but IMHO this is not what the majority would expect. I agree with you that the description in our docs is wrong--strictly technically spoken--but it nevertheless describes the expected behavior. Changing/explaining this causes IMHO more confusion than clarity and therefore I would like to leave it as is. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1164895 http://bugzilla.suse.com/show_bug.cgi?id=1164895#c5 --- Comment #5 from Christopher Yeleighton <giecrilj@stegny.2a.pl> --- (In reply to Frank Sundermeyer from comment #4)
describes the expected behavior. Changing/explaining this causes IMHO more confusion than clarity and therefore I would like to leave it as is.
I would change it to "the previous directory in the current path", which is correct and not oh so confusing IMHO. It works path-wise, not inode-wise. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com