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 3959654
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:45:24+00:00 2026-05-20T02:45:24+00:00

I wrote this script some months ago, and now rereading it, I’m unable to

  • 0

I wrote this script some months ago, and now rereading it, I’m unable to decipher what I meant by this line:

sudo rsync -xPRSaz --rsync-path='sudo rsync' maeve@macbook:/ macbook/ 3>&1 1>&2 2>&3 | tee macbook.log

I can’t find any special treatment of file descriptor 3 for sudo, rsync or tee. After the redirects I’m currently guessing this is the situation:

now fd points to old fd
     0    -->         0
     1    -->         2
     2    -->         1
     3    -->         1
  • Are these redirects applied to sudo, or to rsync, and to what end?
  • Is file descriptor 3 being left unclosed or hanging in any “bad” 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-20T02:45:25+00:00Added an answer on May 20, 2026 at 2:45 am

    Your guess is right. It’s a rather nifty trick to swap standard output and standard error. To answer your questions:

    • these redirections are captured by the shell so they apply to that portion of the pipeline (which is sudo). The sudo process itself will detect all the arguments and pass them along to its subcommand (rsync) but the redirections have been captured and acted upon before that point: sudo never sees them.
    • File handle 3 is not left hanging. It will be closed when the process ends.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I wrote this short script (correct word?) to download the comic images from
This is a crude korn shell script that someone else wrote. I don't know
I once wrote this line in a Java class. This compiled fine in Eclipse
Several months ago, I wrote a blog post detailing how to achieve tab-completion in
We have some html that looks like this: <form id=MyUserControl runat=server method=post> <script language=javascript
I wrote a simple PyGTK script to show some basic process information in a
I'm working on this page for a photographer. I wrote a jQuery script that
I'm trying to write a python script that packages our software. This script needs
I need to write a java script. This is supposed to validate if the
I wrote this function that's supposed to do StringPadRight("Hello", 10, "0") -> "Hello00000" .

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.