scp error while attempting to copy files
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I use scp
to transfer files from my android to my MacBook which works like a charm. But I have a folder called John's folder
on my MacBook so when I attempt to copy a file inside that directory like scp macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder
It throws back an error
unexpected EOF error while looking for matching `âÂÂ`
and
unexpected end of file
How do I resolve this?
scp
add a comment |Â
up vote
3
down vote
favorite
I use scp
to transfer files from my android to my MacBook which works like a charm. But I have a folder called John's folder
on my MacBook so when I attempt to copy a file inside that directory like scp macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder
It throws back an error
unexpected EOF error while looking for matching `âÂÂ`
and
unexpected end of file
How do I resolve this?
scp
Try using double quotes instead:scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder"
. But also just don't give files/directories such crazy names.
â Jesse_b
Apr 19 at 18:23
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I use scp
to transfer files from my android to my MacBook which works like a charm. But I have a folder called John's folder
on my MacBook so when I attempt to copy a file inside that directory like scp macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder
It throws back an error
unexpected EOF error while looking for matching `âÂÂ`
and
unexpected end of file
How do I resolve this?
scp
I use scp
to transfer files from my android to my MacBook which works like a charm. But I have a folder called John's folder
on my MacBook so when I attempt to copy a file inside that directory like scp macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder
It throws back an error
unexpected EOF error while looking for matching `âÂÂ`
and
unexpected end of file
How do I resolve this?
scp
edited Apr 20 at 6:55
roaima
39.4k545106
39.4k545106
asked Apr 19 at 18:20
nobody user
1183
1183
Try using double quotes instead:scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder"
. But also just don't give files/directories such crazy names.
â Jesse_b
Apr 19 at 18:23
add a comment |Â
Try using double quotes instead:scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder"
. But also just don't give files/directories such crazy names.
â Jesse_b
Apr 19 at 18:23
Try using double quotes instead:
scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder"
. But also just don't give files/directories such crazy names.â Jesse_b
Apr 19 at 18:23
Try using double quotes instead:
scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder"
. But also just don't give files/directories such crazy names.â Jesse_b
Apr 19 at 18:23
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
This is interesting. The other answers that I'm seeing are telling you to swap your escaped quote and escaped space for a quoted string. Actually they're equivalent so you'll see no change (a' b
is the same to the shell as "a' b"
).
The problem here lies in the way that scp
on the remote system interprets the command line that it's being given.
As an example, this would work:
scp John's folder/file localhost:/tmp/dst
But this would fail:
scp localhost:/tmp/src/John's folder/file /tmp/dst
(I've used localhost
for the example; you should use user@host
for your situation.)
If you include the -v
(verbose) flag on scp
you can see exactly what's going on that gives rise to the failure:
debug1: Sending command: scp -v -f /tmp/src/John's folder/file
bash: -c: line 0: unexpected EOF while looking for matching `''
bash: -c: line 1: syntax error: unexpected end of file
The unfortunate solution here is that you need to escape special characters (including whitespace) twice - once for the local shell, and once for the remote shell:
scp localhost:"/tmp/src/John's folder/file" /tmp/dst
add a comment |Â
up vote
0
down vote
SCP needs to include one entire parameter in quotations. 2 different answers before me are partially right, but the correct answer is
scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file" storage/folder
Notice that the first parameter is wrapped in quotes, but not the second - if both were wrapped in a single instance of quotations as one comments suggests, the /bin/scp would invoke this as a single parameter, and be expecting another parameter after that.
scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder"
will be read as a single parameter. Even though there is a space there, the double quotes escape that.
Finally, putting quotations in the middle of a parameter like scp macbook@192.168.0.3:"/Users/macbook/desktop/John's folder/file" storage/folder
cuts the paarameter in half and won't make sense to the shell because user@host:/path/to/directory is one full parameter. You can use parts of it, but you cannot cut it in half or it will be examined as 2 different params.
Changing quotes within a token (aka word) works fine in any POSIX shell. Example (in bash):foo=bar; echo fine'$foo'more"$foo"
->fine$foomorebar
â dave_thompson_085
Apr 20 at 7:35
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
This is interesting. The other answers that I'm seeing are telling you to swap your escaped quote and escaped space for a quoted string. Actually they're equivalent so you'll see no change (a' b
is the same to the shell as "a' b"
).
The problem here lies in the way that scp
on the remote system interprets the command line that it's being given.
As an example, this would work:
scp John's folder/file localhost:/tmp/dst
But this would fail:
scp localhost:/tmp/src/John's folder/file /tmp/dst
(I've used localhost
for the example; you should use user@host
for your situation.)
If you include the -v
(verbose) flag on scp
you can see exactly what's going on that gives rise to the failure:
debug1: Sending command: scp -v -f /tmp/src/John's folder/file
bash: -c: line 0: unexpected EOF while looking for matching `''
bash: -c: line 1: syntax error: unexpected end of file
The unfortunate solution here is that you need to escape special characters (including whitespace) twice - once for the local shell, and once for the remote shell:
scp localhost:"/tmp/src/John's folder/file" /tmp/dst
add a comment |Â
up vote
2
down vote
accepted
This is interesting. The other answers that I'm seeing are telling you to swap your escaped quote and escaped space for a quoted string. Actually they're equivalent so you'll see no change (a' b
is the same to the shell as "a' b"
).
The problem here lies in the way that scp
on the remote system interprets the command line that it's being given.
As an example, this would work:
scp John's folder/file localhost:/tmp/dst
But this would fail:
scp localhost:/tmp/src/John's folder/file /tmp/dst
(I've used localhost
for the example; you should use user@host
for your situation.)
If you include the -v
(verbose) flag on scp
you can see exactly what's going on that gives rise to the failure:
debug1: Sending command: scp -v -f /tmp/src/John's folder/file
bash: -c: line 0: unexpected EOF while looking for matching `''
bash: -c: line 1: syntax error: unexpected end of file
The unfortunate solution here is that you need to escape special characters (including whitespace) twice - once for the local shell, and once for the remote shell:
scp localhost:"/tmp/src/John's folder/file" /tmp/dst
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
This is interesting. The other answers that I'm seeing are telling you to swap your escaped quote and escaped space for a quoted string. Actually they're equivalent so you'll see no change (a' b
is the same to the shell as "a' b"
).
The problem here lies in the way that scp
on the remote system interprets the command line that it's being given.
As an example, this would work:
scp John's folder/file localhost:/tmp/dst
But this would fail:
scp localhost:/tmp/src/John's folder/file /tmp/dst
(I've used localhost
for the example; you should use user@host
for your situation.)
If you include the -v
(verbose) flag on scp
you can see exactly what's going on that gives rise to the failure:
debug1: Sending command: scp -v -f /tmp/src/John's folder/file
bash: -c: line 0: unexpected EOF while looking for matching `''
bash: -c: line 1: syntax error: unexpected end of file
The unfortunate solution here is that you need to escape special characters (including whitespace) twice - once for the local shell, and once for the remote shell:
scp localhost:"/tmp/src/John's folder/file" /tmp/dst
This is interesting. The other answers that I'm seeing are telling you to swap your escaped quote and escaped space for a quoted string. Actually they're equivalent so you'll see no change (a' b
is the same to the shell as "a' b"
).
The problem here lies in the way that scp
on the remote system interprets the command line that it's being given.
As an example, this would work:
scp John's folder/file localhost:/tmp/dst
But this would fail:
scp localhost:/tmp/src/John's folder/file /tmp/dst
(I've used localhost
for the example; you should use user@host
for your situation.)
If you include the -v
(verbose) flag on scp
you can see exactly what's going on that gives rise to the failure:
debug1: Sending command: scp -v -f /tmp/src/John's folder/file
bash: -c: line 0: unexpected EOF while looking for matching `''
bash: -c: line 1: syntax error: unexpected end of file
The unfortunate solution here is that you need to escape special characters (including whitespace) twice - once for the local shell, and once for the remote shell:
scp localhost:"/tmp/src/John's folder/file" /tmp/dst
edited Apr 19 at 19:45
answered Apr 19 at 19:38
roaima
39.4k545106
39.4k545106
add a comment |Â
add a comment |Â
up vote
0
down vote
SCP needs to include one entire parameter in quotations. 2 different answers before me are partially right, but the correct answer is
scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file" storage/folder
Notice that the first parameter is wrapped in quotes, but not the second - if both were wrapped in a single instance of quotations as one comments suggests, the /bin/scp would invoke this as a single parameter, and be expecting another parameter after that.
scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder"
will be read as a single parameter. Even though there is a space there, the double quotes escape that.
Finally, putting quotations in the middle of a parameter like scp macbook@192.168.0.3:"/Users/macbook/desktop/John's folder/file" storage/folder
cuts the paarameter in half and won't make sense to the shell because user@host:/path/to/directory is one full parameter. You can use parts of it, but you cannot cut it in half or it will be examined as 2 different params.
Changing quotes within a token (aka word) works fine in any POSIX shell. Example (in bash):foo=bar; echo fine'$foo'more"$foo"
->fine$foomorebar
â dave_thompson_085
Apr 20 at 7:35
add a comment |Â
up vote
0
down vote
SCP needs to include one entire parameter in quotations. 2 different answers before me are partially right, but the correct answer is
scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file" storage/folder
Notice that the first parameter is wrapped in quotes, but not the second - if both were wrapped in a single instance of quotations as one comments suggests, the /bin/scp would invoke this as a single parameter, and be expecting another parameter after that.
scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder"
will be read as a single parameter. Even though there is a space there, the double quotes escape that.
Finally, putting quotations in the middle of a parameter like scp macbook@192.168.0.3:"/Users/macbook/desktop/John's folder/file" storage/folder
cuts the paarameter in half and won't make sense to the shell because user@host:/path/to/directory is one full parameter. You can use parts of it, but you cannot cut it in half or it will be examined as 2 different params.
Changing quotes within a token (aka word) works fine in any POSIX shell. Example (in bash):foo=bar; echo fine'$foo'more"$foo"
->fine$foomorebar
â dave_thompson_085
Apr 20 at 7:35
add a comment |Â
up vote
0
down vote
up vote
0
down vote
SCP needs to include one entire parameter in quotations. 2 different answers before me are partially right, but the correct answer is
scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file" storage/folder
Notice that the first parameter is wrapped in quotes, but not the second - if both were wrapped in a single instance of quotations as one comments suggests, the /bin/scp would invoke this as a single parameter, and be expecting another parameter after that.
scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder"
will be read as a single parameter. Even though there is a space there, the double quotes escape that.
Finally, putting quotations in the middle of a parameter like scp macbook@192.168.0.3:"/Users/macbook/desktop/John's folder/file" storage/folder
cuts the paarameter in half and won't make sense to the shell because user@host:/path/to/directory is one full parameter. You can use parts of it, but you cannot cut it in half or it will be examined as 2 different params.
SCP needs to include one entire parameter in quotations. 2 different answers before me are partially right, but the correct answer is
scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file" storage/folder
Notice that the first parameter is wrapped in quotes, but not the second - if both were wrapped in a single instance of quotations as one comments suggests, the /bin/scp would invoke this as a single parameter, and be expecting another parameter after that.
scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder"
will be read as a single parameter. Even though there is a space there, the double quotes escape that.
Finally, putting quotations in the middle of a parameter like scp macbook@192.168.0.3:"/Users/macbook/desktop/John's folder/file" storage/folder
cuts the paarameter in half and won't make sense to the shell because user@host:/path/to/directory is one full parameter. You can use parts of it, but you cannot cut it in half or it will be examined as 2 different params.
answered Apr 19 at 19:09
SomeGuy
212112
212112
Changing quotes within a token (aka word) works fine in any POSIX shell. Example (in bash):foo=bar; echo fine'$foo'more"$foo"
->fine$foomorebar
â dave_thompson_085
Apr 20 at 7:35
add a comment |Â
Changing quotes within a token (aka word) works fine in any POSIX shell. Example (in bash):foo=bar; echo fine'$foo'more"$foo"
->fine$foomorebar
â dave_thompson_085
Apr 20 at 7:35
Changing quotes within a token (aka word) works fine in any POSIX shell. Example (in bash):
foo=bar; echo fine'$foo'more"$foo"
-> fine$foomorebar
â dave_thompson_085
Apr 20 at 7:35
Changing quotes within a token (aka word) works fine in any POSIX shell. Example (in bash):
foo=bar; echo fine'$foo'more"$foo"
-> fine$foomorebar
â dave_thompson_085
Apr 20 at 7:35
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f438791%2fscp-error-while-attempting-to-copy-files%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Try using double quotes instead:
scp "macbook@192.168.0.3:/Users/macbook/desktop/John's folder/file storage/folder"
. But also just don't give files/directories such crazy names.â Jesse_b
Apr 19 at 18:23