On 12/07/2011 06:21 AM, ha...@noel.feld.cvut.cz wrote: > Description: > cd silently ignores additional arguments > pwd, pushd and popd also do ignore additional arguments > > This seemes to be a long standing behavior, it is the same in bash > 3.1.17. > > Problem is also described here: > http://old.nabble.com/cd-with-multiple-arguments--td30418151.html > > This bug is mostly benign, however missing newline at the end of a cd > command leads to > silent skip of the following command line. Error report would help here. > > Repeat-By: > cd xxx yyy > > No error is reported for yyy. > > Fix: > Make bash to report error for superfluous arguments for cd, pwd, pushd > and popd. > Alternatively, describe current behavior in bash man page (and > preferably > explain - maybe it is required for compatibility with some historical > shell?)
Or even nicer, behave like zsh, and treat cd xxx yyy like this (written assuming extglob syntax) cd xxx+($' \t')yyy POSIX does not require 'cd xxx yyy' to fail, it only requires that portable applications pass at most one argument to cd, such that passing more than one argument triggers unspecified behavior. We might as well make that behavior intuitive. -- Eric Blake ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature