• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: do shell script without blocking?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script without blocking?


  • Subject: Re: do shell script without blocking?
  • From: "Adam K. Wuellner" <email@hidden>
  • Date: Wed, 16 Feb 2005 11:06:36 -0600


On Feb 16, 2005, at 10:43 AM, Stephen Jonke wrote:

What does the & mean in that context?  2>&1 as opposed to 2>1?

Steve

I'd love an explanation in plain English, too... I suspect it's necessary to distinguish between file descriptors (0, 1, 2), and filenames. Perhaps 2>1 redirects STDERR to a file named "1", rather than combining STDERR and STDOUT. Just guessing, here.


Here, FWIW, is what the bash manpage has to say about it:

[...]
Redirecting Standard Output and Standard Error
Bash allows both the standard output (file descriptor 1) and the stan-
dard error output (file descriptor 2) to be redirected to the file
whose name is the expansion of word with this construct.


There are two formats for redirecting standard output and standard
error:


              &>word
       and
              >&word

Of the two forms, the first is preferred. This is semantically equiva-
lent to


              >word 2>&1

[...]
 Duplicating File Descriptors
       The redirection operator

              [n]<&word

is used to duplicate input file descriptors. If word expands to one or
more digits, the file descriptor denoted by n is made to be a copy of
that file descriptor. If the digits in word do not specify a file
descriptor open for input, a redirection error occurs. If word evalu-
ates to -, file descriptor n is closed. If n is not specified, the
standard input (file descriptor 0) is used.


       The operator

              [n]>&word

is used similarly to duplicate output file descriptors. If n is not
specified, the standard output (file descriptor 1) is used. If the
digits in word do not specify a file descriptor open for output, a
redirection error occurs. As a special case, if n is omitted, and word
does not expand to one or more digits, the standard output and standard
error are redirected as described previously.
[...]


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: do shell script without blocking?
      • From: Christopher Nebel <email@hidden>
References: 
 >Re: do shell script without blocking? (From: Martin Orpen <email@hidden>)
 >Re: do shell script without blocking? (From: Stephen Jonke <email@hidden>)

  • Prev by Date: Re: do shell script without blocking?
  • Next by Date: Re: do shell script without blocking?
  • Previous by thread: Re: do shell script without blocking?
  • Next by thread: Re: do shell script without blocking?
  • Index(es):
    • Date
    • Thread