Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-21-2010, 08:19 PM   #1
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@\ Backup\ Folder/ ; expect assword ; send "MYPASSWORD\n" ; interact;'
Old 01-21-2010, 08:40 PM   #2
LQ 5k Club
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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
Registered: Oct 2009
Location: England
Distribution: Kubuntu, Ubuntu, Debian, Proxmox.
Posts: 553

Rep: Reputation: 115Reputation: 115
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
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
LQ Newbie
Registered: Jan 2010
Posts: 6

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


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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:14 AM.

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