Bug 111467 - Filename completion does not escape spaces
Summary: Filename completion does not escape spaces
Alias: None
Product: Fedora
Classification: Fedora
Component: pdksh (Show other bugs)
(Show other bugs)
Version: 1
Hardware: i386 Linux
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2003-12-04 00:05 UTC by Greg Mohney
Modified: 2007-11-30 22:10 UTC (History)
0 users

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

Attachments (Terms of Use)

Description Greg Mohney 2003-12-04 00:05:41 UTC
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 13:37:25 UTC
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.