Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I have an rsync command that works fine from either the Bash command line or a Bash script.

The command is: rsync -qtz user@hostname:/tmp/p /tmp

When I run the command, it copies the file and runs in less than a second.

If I put the command in a Perl script, the script hangs, and I have to Control-C to kill it.

The Perl script is just this:

system("rsync -qtz user@hostname:/tmp/p /tmp");

What could be going wrong? Other commands (like mv and gzip) work fine in the Perl script. I tried specifying the4 complete path to /usr/bin/rsync, but it doesn't help.

share|improve this question
up vote 1 down vote accepted

The @ symbol is special inside double quoted strings in Perl.

It is trying to find an array named @hostname and expand it. @hostname is not set, so it is expanding to rsync -qtz user:/tmp/p /tmp.


system("rsync -qtz user\@hostname:/tmp/p /tmp");


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.