Red Hat Bugzilla – Bug 111467
Filename completion does not escape spaces
Last modified: 2007-11-30 17:10:34 EST
Description of problem: The pdksh does not escape spaces or other special characters when doing filename completion, as in bash. For example, under bash: $ ls My Documents/ foo bar $ cd M[TAB] the directory name will be expanded with the space escaped: $ cd My\ Documents/ $ Using pdksh, the filename is successfully completed, but the space is not escaped (vi line editing mode shown): $ cd M[Meta-\] results in: $ cd My Documents/ ksh: cd: bad substitution $ Version-Release number of selected component (if applicable): pdksh-5.2.14-23 How reproducible: Always Steps to Reproduce: 1. Execute /bin/ksh (pdksh) 2. Execute `echo bar > "file with spaces"` 3. Execute `cat fil[Meta-\]` (or whatever key sequence you have chosen to do filename completion in pdksh; this depends on the line editing mode you choose. in vi mode, this is Meta-\) Actual Results: Note that without manually escaping the spaces or enclosing the entire filename in quotes, the contents of the file will not be displayed with the error: cat: file: No such file or directory because the filename is expanded without escaping the spaces: $ cat file with spaces Expected Results: As in bash, the spaces at least should be escaped for convenience and security reasons. $ cat fil[Meta-\] should result in the following completion: $ cat file\ with\ spaces Additional info: I seem to be the only person who cares about this. However, it is a bug and should be fixed :-) Note the following url, I have one lone sympathizer who noticed this bug in NetBSD and submitted a partial patch (only works in vi line-editing mode): http://mail-index.netbsd.org/tech-userlevel/1999/09/21/0000.html
We've removed pdksh and switched to AT&T's Kornshell.