0

Its a simple problem but I'm unable to select folders in my directory that contain a space.

For example, I'm trying to build a music playlist using Ruby for one of Chris Pine's Programming Problems. The music I want to shuffle is stored in iTunes Music, but every time I try to change my directory, the command line says that no such file/folder exists. How can I select it without having to change EVERYTHING to iTunes_Music with an underscore?

Dan Rubio
  • 4,709
  • 10
  • 49
  • 106
  • Given that we can't see what you've tried, I can only guess that you are not quoting your "directory with spaces" names in your script... – twalberg Feb 13 '14 at 15:32
  • Thanks for the reply twalberg. The Chris Pine problem was just for context, I meant trying to move to the file as a directory. For example if I put in the command prompt: cd iTunes Music it will return an error saying that the folder does not exist when it clearly does. What I want to know is there a way around that or do I have to rename all of my files so I put in the command line: cd iTunes_Music – Dan Rubio Feb 13 '14 at 16:30
  • Correct, because you're not doing `cd "iTunes Music"` - the shell splits your command on whitespace in the absence of quotes (or escaping - you could alternatively `cd iTunes\ Music`...), so what you're trying to do is `cd iTunes`, with the `Music` bit being an ignored second argument, and the `iTunes` directory does not exist... – twalberg Feb 13 '14 at 16:40
  • Oh ok, I got it now.Thanks for the clarification twalberg. I appreciate it. – Dan Rubio Feb 13 '14 at 16:50

0 Answers0