Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 111467 - Filename completion does not escape spaces
Filename completion does not escape spaces
Product: Fedora
Classification: Fedora
Component: pdksh (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Karsten Hopp
Depends On:
  Show dependency treegraph
Reported: 2003-12-03 19:05 EST by Greg Mohney
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-02-02 08:37:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Greg Mohney 2003-12-03 19:05:41 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):

How reproducible:

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):

Comment 1 Karsten Hopp 2005-02-02 08:37:25 EST
We've removed pdksh and switched to AT&T's Kornshell. 

Note You need to log in before you can comment on or make changes to this bug.