This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: space in dir name


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]