Description of problem: cd wildcard behavior change from fedora 25. Now, multiple dirs (f12, f13, f14) when the first is desired this "cd f*" returns "bash: cd: too many arguments" Previous behavior took you into f12 directory. Version-Release number of selected component (if applicable): Bash version: bash.x86_64 4.4.12-6.fc26 How reproducible: Very. Steps to Reproduce: 1. 2. 3. Actual results: See above Expected results: See above Additional info:
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.