LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-21-2010, 08:19 PM   #1
tfranklin
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Rep: Reputation: 0
Trying to Run Linux Command with Spaces!


Hey all,
Need a little help, im trying to run an scp command on my linux server, this is working fine, however i changed the output folder to one which has spaces and now when run,it's coming up saying
SCP ambiguous target

Here's my string, any ideas?

expect -c 'spawn scp -r /var/lib/asterisk/backups/Everyday/ administrator@192.1.1.1:/Volumes/Data1/My\ Backup\ Folder/ ; expect assword ; send "MYPASSWORD\n" ; interact;'
 
Old 01-21-2010, 08:40 PM   #2
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
Try putting double quotes ("") around the path.

And do the names have to have spaces in them? Why not use dashes (-) or underscores (_)?
 
Old 01-21-2010, 08:42 PM   #3
cantab
Member
 
Registered: Oct 2009
Location: England
Distribution: *buntu, Vector
Posts: 499

Rep: Reputation: 102Reputation: 102
Try doubly escaping the spaces, like

My\\\ Backup\\\ Folder

also, should it say expect assword? shouldn't that be password?
 
1 members found this post helpful.
Old 01-21-2010, 08:44 PM   #4
tfranklin
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
haha that's what I thought, but password doesn't seem to work, ASSword words a treat however.
 
Old 01-21-2010, 08:45 PM   #5
tfranklin
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
the \\\ works thanks +1 thanks
 
  


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
How to add some spaces in sed command? reconcil Linux - Newbie 2 11-05-2007 12:00 PM
Need Command to see free spaces shipon_97 Linux - Newbie 4 11-24-2006 09:50 AM
Use spaces in command line? Geminias Linux - Newbie 2 01-03-2006 08:37 PM
how to make the Read command handles spaces Kilahchris Linux - Newbie 7 11-06-2004 01:10 PM
Spaces on command line odd Linux - Software 2 05-22-2004 09:17 AM


All times are GMT -5. The time now is 11:33 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration