Subject: Spaces in file names

From: Reed Loefgren <[email-masked]>
Date: Mon, 17 Jul 2000 09:47:33 -0400

Hi all,

  I serve my Mac files from a linuxppc server. If, while at a linux box,
I go into the server to the Mac files' directory the proper directory
and file names are displayed; including spaces in those names. How can I
"cd" into one of those directories? Do I have to go to the Mac and
remove spaces from names to make them accessible to Linux?
  I've already tried cd [word][option-spacebar for "hard space"][word],
but this isn't accepted by bash. What's the trick, or is it just not
do-able?

Thanks,

Reed
-- 
XI. The more you spend,
    The more you save.

---

From: Michalowski Thierry <[email-masked]>
Date: Mon, 17 Jul 2000 17:51:28 +0200

The "trick" is to tell your shell not to interpret the spaces as separaors
between arguments. This is called "escaping" the character.
You can do it in many ways:
-enclose within double-quotes : cd "my directory"
 This allows for variable interpolation within the quotes
-enclose within simple-quotes : cd 'my directory"
 This disallows variable interpolation within the quotes, making it easier
if you happen to have a "$" sign in the name
-escape the character with \ before it: cd my\ directory .
 The \ sign only escape one single character at a time, whereas the quotes
escape everything that is enclosed.
This (putting a \) is the way bash or tcsh will complete your command line
if you try typing the beginning of the name then the tabulation key.

HTH
Thierry

-----Original Message-----
From: Reed Loefgren [mailto:[email-masked]]
Sent: Monday, July 17, 2000 3:48 PM
To: [email-masked]
Subject: Spaces in file names

Hi all,

Thanks,

Reed
-- 
XI. The more you spend,
    The more you save.

---

From: Hoover Chan <[email-masked]>
Date: Mon, 17 Jul 2000 08:53:37 -0700

Put the file or path name within quotes.

For example, 

cd /path_name/mac_file_directory/"filename with spaces in it"

-----------------------------------------------------------------
Hoover Chan                [email-masked]  -or-  [email-masked]
Eastwind Associates

---

From: Reed Loefgren <[email-masked]>
Date: Mon, 17 Jul 2000 10:09:57 -0400

Geez Loueez, you guys are fast...

Thanks again (I don't even think the ink was dry on my post :^)

Reed
-- 
XI. The more you spend,
    The more you save.