Newsgroups: comp.os.msdos.djgpp From: design AT netcom DOT com (Chris Waters) Subject: Re: Changing directories with Bash? Message-ID: Organization: Design and Delivery References: Date: Tue, 26 Nov 1996 09:51:52 GMT Lines: 53 Sender: design AT netcom8 DOT netcom DOT com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp In article , Patrick wrote: >Suppose I want to change dirs to \Program Files. Unix (afaik) doesn't >allow spaces. Is there any way around this? I tried: >1. putting the " the microsoft has you put Using the Unix version of bash: ~$ md "has space" ~$ cd "has space" ~/has space$ cd .. ~$ rmdir "has space" ~$ If this doesn't work in the djgpp version, there's a problem, and I'd report it to the person who ported bash. (I can't try it because I don't have a version of DOS that supports long filenames.) >2. "dir" and 'd' print out backslashes after every word in a long filename >(w/ spaces). On a guess, I tried changing dirs with one of the seperated >(by a backslash) words. THis works about 50% of the time. What's "dir"? What's 'd'? Normally, "dir" is a COMMAND.COM builtin, and doesn't work under Unix-like shells for DOS. Are these some sort of builtins added to the DOS version of bash, or scripts you wrote, or something entirely different? The backslash is an escape (much like in C strings). Again, this works under Unix: ~$ md has\ space ~$ cd has\ space ~/has space$ cd .. ~$ cd "has space" ~/has space$ cd .. ~$ It should work 100% of the time, as should the double quotes. BTW, is it possible that your problem is as simple as using the wrong slashes? Try using forward slashes as directory separators, i.e.: bash$ cd "/Program Files" or bash$ cd /Program\ Files rather than: bash$ cd "\Program Files" The first two will look for the directory in the root, the last in the current directory.