LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 06-21-2006, 06:24 PM   #1
Peter Shepard
Member
 
Registered: Apr 2005
Posts: 96

Rep: Reputation: 15
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
 
Old 06-21-2006, 07:16 PM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
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/

Last edited by jschiwal; 06-21-2006 at 07:21 PM.
 
Old 06-21-2006, 07:19 PM   #3
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
In fstab, spaces and other characters should be escaped with a backslash, as in My\ Documents, MMG\ Files, or Image\ Files.
 
Old 06-21-2006, 07:25 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
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'.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
windows space character equivalent powereds Linux - Networking 3 07-06-2005 06:06 AM
MySQL: Login as Blank User From Command Line tortle Linux - Software 1 05-14-2005 06:01 PM
Blank Screen after Suse Boot - HowTo boot from grub to command line benco420 Linux - Newbie 3 02-13-2005 06:50 AM
Is linux *blank* up my windows space? mimithebrain General 0 06-13-2004 09:05 PM
how do I print 'blank space' to standard out in C on same line? purpleburple Programming 7 08-19-2002 12:54 AM


All times are GMT -5. The time now is 05:08 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration