Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Why do I get a different behavior of the scp command in csh and bash?

Same command is working in csh shell, but it not working in bash shell.

Please can anybody help?

bash-3.2$  csh
Linux-007% scp root@{/root/install.log} /
install.log 100% 98KB 97.6KB/s 00:00
Linux-007%  which scp

Linux-007% bash
bash-3.2$  scp root@{/root/install.log} /
scp: /{/root/install.log}: No such file or directory
bash-3.2$ which scp
share|improve this question

migrated from Nov 2 '11 at 7:47

This question came from our site for professional and enthusiast programmers.

scp isn't the issue. The problem is in the way the two shells handle curly braces.

csh% echo root@{/root/install.log}

bash$ echo root@{/root/install.log}

Why do you want the curly braces anyway?

share|improve this answer
yes, I want to copy multiple file. – user87005 Nov 2 '11 at 7:35
The command you showed us only copies one file. But if you want the braces to be interpreted on the remote system, put single quotes around the argument: scp 'root@{/root/install.log}' /. – Keith Thompson Nov 2 '11 at 7:38
same problem bash-3.2$ scp root@'{/root/install.log}' / root@12.3.4's password: scp: /{/root/install.log}: No such file or directory – user87005 Nov 2 '11 at 7:42
Then drop the braces. If you're copying a single file, as you seem to be trying to do in your example, don't use braces. If you really need to copy multiple files, use braces and commas, and quote them: scp root@{this_file,that_file}' / – Keith Thompson Nov 2 '11 at 9:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .