Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1032563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:05:47+00:00 2026-05-16T14:05:47+00:00

I normally work these things out reasonably quickly, but this one is a headache.

  • 0

I normally work these things out reasonably quickly, but this one is a headache.

I have a shell script that loads some info about where to connect to and how from a text file, this is done using the read command. This works. It stores the arguments to be sent onto RSync in a variable call $rsyncargs.

I want to use the RSync arg -e which is used to pass details onto ssh, in my case a port number as so:

rsync -avz -e "ssh -p 222" dir/ bob@server.com:dir/

the line in the text file looks like so:

-e "ssh -p 222"

the line of bash should be something like:

rsync -avz $rsyncargs $src $dst

this all works, except that the quotes mess up and I end up with

sending incremental file list
rsync: link_stat "/dir/to/shell/script/222"" failed: No such file or directory (2)

So it’s trying to parse the contents of the quotes at the wrong stage. I’ve tried a list of different escaping mechanisms (like backslashes in the text file and using single quotes instead of double quotes in several places etc) but it all seems to end with similarly catastrophic (though not always identical) error messages.

any suggestions would be greatly appreciated (either to solve the original problem, or to get the ssh port changed in a less annoying way)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:05:47+00:00Added an answer on May 16, 2026 at 2:05 pm

    you can always set the port in your ssh config:

    >cat ~/.ssh/config
    Host shortName
       Hostname [actual url or ip]
       User otherUserName
       Port 22
       ForwardAgent yes
       ForwardX11 yes
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'll preface this by saying that I usually work in C#/.Net. Normally, I use
I normally work on single threaded applications and have generally never really bothered with
I normally don't work on Windows development, and am completely unfamiliar with the toolchain
I normally run VS 2008 at home and LINQ is built in. At work
Normally I use imagecreatefromjpeg() and then getimagesize() , but with Firefox 3 I need
Normally you can do this: <select size=3> <option>blah</option> <option>blah</option> <option>blah</option> </select> And it would
Normally, in Delphi one would declare a function with a variable number of arguments
I'm trying to work out the best way to assemble the navigation menu of
Can someone explain why this code doesn't work as expected? I would expect it
I have a wordpress blog. I made a custom page-template that allows users to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.