LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   what is the Linux command line character for a blank space? (http://www.linuxquestions.org/questions/red-hat-31/what-is-the-linux-command-line-character-for-a-blank-space-457048/)

Peter Shepard 06-21-2006 05:24 PM

what is the Linux command line character for a blank space?
 
Hello,

I am trying to type a command line in linux which has a Windows path in the options portion of thye command. The windows path has a blank in it! So of course linux misinterprets this. QUESTION is there a way to type the following command into a command line and have the blank space recognized as a command line?


smbmount //126.195.176.11/MMG Drive /mnt/winclient-cdrom -o

In short, waht is the Linux command line character for a blank space?
Thanks,

Peter

jschiwal 06-21-2006 06:16 PM

In the shell, use a backslash to escape characters such as spaces, or use double or single quotes around the entire name. However I am not certain whether either will work in the /etc/fstab file, because it depends on how the mount command parses the file. I think you might try both to see which works. The info bash reference explains the difference between single and double quote usage. One difference is that you can use variable expansion inside double quotes but not single quotes, where the $ symbol is taken literally.

some examples:
ls /mnt/mmc\ mount/a*.pdf
ls "$HOME/My Documents/"
mv 'very stupid$filename' $HOME/documents/

Matir 06-21-2006 06:19 PM

In fstab, spaces and other characters should be escaped with a backslash, as in My\ Documents, MMG\ Files, or Image\ Files.

jschiwal 06-21-2006 06:25 PM

I read the "man 5 fstab" man page to read up on escaping spaces. Here is the quote:
Quote:

The second field, (fs_file), describes the mount point for the filesystem.
For swap partitions, this field should be specified as `none'. If the
name of the mount point contains spaces these can be escaped as `\040'.


All times are GMT -5. The time now is 09:30 AM.