Bug 1480307
Summary: | behavior change in "cd f*" | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Karl Burkett <burkett> |
Component: | bash | Assignee: | Siteshwar Vashisht <svashisht> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | low | Docs Contact: | |
Priority: | unspecified | ||
Version: | 26 | CC: | admiller, burkett, kdudka, svashisht |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-08-11 14:26:21 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Karl Burkett
2017-08-10 16:13:05 UTC
This seems to be built-time configurable: https://git.savannah.gnu.org/cgit/bash.git/tree/config-top.h?id=bc007799#n30 Note that no wildcard is needed to get the fatal error. It triggers whenever 'cd' gets more than one arguments. It makes sense to show error message if multiple arguments are passed to 'cd'. Why do you think it's a bug ? It is a bug because this is a fundamental change in behavior with respect to wilecards. I, and I suspect others as well, use the wildcard as a shorthand method of specifying the first directory in a list of similar names. For interactive use, going to the wrong directory is quickly obvious and for scripts, I doubt wildcard usage is common. Now, in terms of implementation on the system, Fedora 26 has introduced several difficulties with a simple, core command: There is no longer a standalone cd command on the system: (/bin/cd and /usr/bin/cd contain the same code) $> cat /usr/bin/cd #!/bin/sh builtin cd "$@" Problems as I see them: /bin/sh is not the correct shell in general terms it's a symlink after all, /bin/bash is specific and has the builtin. $@ is already expanded by the calling shell, so the new instance of bash does not realize that this is a wildcard request. Your thoughts? It is not a behavior change with wildcards. It is a change in terms of how 'cd' builtin handles it's arguments. It is non-intuitive to pass multiple arguments to cd builtin and expect it to ignore all arguments except first one. I fail to see how the example about '/usr/bin/cd' relates to this behavior. This behavior change was introduced with this commit[1]. The script under /usr/bin/cd is provided for POSIX compliance (See bug 820192) and was present before Fedora 26. [1] http://git.savannah.gnu.org/cgit/bash.git/diff/config-top.h?id=3475994a81ce49cf3a50b6ceeb5ad719986aa5f4 We will just have to agree to disagree on this issue. Strict enforcement does not necessarily make it right or acceptable to everyone. |