Subject: Re: ksh: escape spaces when expanding
To: None <>
From: Christos Zoulas <>
List: tech-userlevel
Date: 09/21/1999 18:46:11
In article <>,
Jaromir Dolecek <> wrote:
>what always bothered me that pdksh's tab expanding doesn't really play well 
>with filenames containing spaces. While playing with CygWin, I
>found out that bash uses nice hack - it just escapes the space with
>a backslash. So I implemented the same for ksh. 
>Note that only spaces are currently supported. Adding e.g. tab would
>not be hard, but I haven't came across any filename containing it yet.
>If nobody would complain, I'll commit the changes shortly.
>Please keep me on CC, I'm not subscribed on

Well, that does not work properly in all cases. You need to do what tcsh does,
which is to parse the line to see if you are inside quotes.


% ls
foo bar.txt
% cat "foo<tab>
% cat "foo bar.txt"
% cat 'foo<tab>
% cat 'foo bar.txt'
% cat \'foo<tab>
% cat \'foo\ bar.txt