space in dir name

Buchbinder, Barry (NIH/NIAID) [E] BBuchbinder@niaid.nih.gov
Tue Dec 19 04:12:00 GMT 2006


Sunil Ravipati wrote
> I am a newbie. I installed cygwin on winXP. In the bash shell,
> I want to access Program Files by cd Program Files but I get
> is cd Program\ Files/ . 
> 
> How do i get rid off the slashes for the dir names with spaces.
 
Don't get rid of them.

The slash on the end of Files/ is harmless.  cd will ignore it.
I find it useful*.  With it, I do not need to type the slash when
cd'ing into a subdirectory of Program Files/.  But if you must
get rid of it, the "mark-directories" directive of readline or
bash is probably what you want.  See man bash or man readline.

The back slash on the end of Program\ is essential.  The backslash
escapes the space so bash thinks that Program Files is a single
argument.  If you get rid of it, you must put either single or
double quotes around the argument: "Program Files" or
'Program Files'.  (If you are familiar with file/directory
completion in cmd.exe, it puts double quotes to accomplish the same
thing.)

(*I find cmd.exe's lack of adding a trailing backslash a
major annoyance.)

- Barry

Disclaimer: Statements made herein are not made on behalf of NIAID.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list