public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Alec Warner <antarus@gentoo.org>
To: Jonathan Callen <abcd@gentoo.org>
Cc: gentoo-dev@lists.gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] Re: [PATCH 1/2] Introduce multibuild_merge_root() to merge interim installs.
Date: Sat, 23 Mar 2013 12:02:29 -0700	[thread overview]
Message-ID: <CAAr7Pr_5OtcSiT9nBut=zeFQuoVaqc0QArm9_4_WZhabng4FnA@mail.gmail.com> (raw)
In-Reply-To: <514DFB16.9060701@gentoo.org>

On Sat, Mar 23, 2013 at 11:57 AM, Jonathan Callen <abcd@gentoo.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> On 03/23/2013 01:44 PM, Alec Warner wrote:
>> On Sat, Mar 23, 2013 at 9:26 AM, Michał Górny <mgorny@gentoo.org>
>> wrote:
>>> +                       # Close the lock file when we are done
>>> with it. +                       # Prevents deadlock if we aren't
>>> in a subshell. +                       eval "exec ${lock_fd}>&-"
>>
>> Not following this bit.
>>
>> The bash manpage says N>&DIGIT- redirects fd DIGIT to fd N. N may
>> be unspecified and defaults to 1.
>>
>> It doesn't say what happens if DIGIT is unspecified. Nor does it
>> say it closes any file descriptors.
>>
>
> The relevant section of bash(1) is reproduced below:
>
>    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 evaluates 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.
>
> While the outcome of n>&- is not specified directly in the man page,
> it is treated exactly as n<&- is.

Ahh, I was reading:

   Moving File Descriptors
       The redirection operator

              [n]<&digit-

       moves the file descriptor digit to file descriptor n, or the
standard input (file descriptor 0) if n is not specified.  digit is
closed
       after being duplicated to n.

       Similarly, the redirection operator

              [n]>&digit-

       moves the file descriptor digit to file descriptor n, or the
standard output (file descriptor 1) if n is not specified.

I see where i went wrong now ;)

>
> - --
> Jonathan Callen
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.19 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCgAGBQJRTfsWAAoJELHSF2kinlg4MO0P+wTQovWzYdfSgUP8H4WFmO1y
> fpERqd1ZIoPle5Gl5+IUOWIHoMqkjS3mIAYUKF9cYwkufHRjbIs9l6NFGZg4wbRj
> baCW6dRTbnbaM/YSiHLlstb4I5fcSwldwhtJrMuO9O6qLq2IFupJYkaSLnYJMs6C
> HspU9W+bw4Vuvlk2wnhjGDGUj06ZIifQEOE6NYUVqF4GQaZlZpCsgA5BADPQL8zL
> RAb90dJuRIuPPwgzuFka1+h0z4Sg5xxSlV7FS4c+r+HzrZCHHIHSyi9lOpOPB/8M
> P+ZzJyDD3weW5AnAIuDjhJ3Rt0wI/2oYRRoVmC6hZ1CNSZuSjUCdWi6jvIvg99cR
> TscJ0dKBl7bMcrrIILcXYgHtyKC/QRZWp6r0JxqOwX4L7FbPhF3qbtano+TxoCSr
> X7hfCuRab1FEPE+jXeprH0c+N31SHrVBxfkJDG39MVx8hdJqXYzKCXah5/6lMJ63
> Td2lc7Y3UBuXpxvQBoBCWTEV3vmKBrNX6v5Bu9TTLmrhfkcMsjCMX6TdU54tUoEU
> YE37njpI4Thsl24/LPQtzkR8v9fVyYqVvvXylSq5HcM48VlqlhcI/EP0SRo9eUXu
> CFRkwb7u5nX4YOdUMj+L0P59/N7Zobdfs/dCvGB4PDeJTqzFJowxVhm7Dh1Uxf6l
> a1CBWFm9+S7kUPDTfwV6
> =tFvf
> -----END PGP SIGNATURE-----


  reply	other threads:[~2013-03-23 19:02 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23 16:25 [gentoo-dev] [PATCHES] Header wrapping support for multilib Michał Górny
2013-03-23 16:26 ` [gentoo-dev] [PATCH 1/2] Introduce multibuild_merge_root() to merge interim installs Michał Górny
2013-03-23 17:00   ` Ulrich Mueller
2013-03-23 17:28     ` Michał Górny
2013-03-24  7:47       ` Ulrich Mueller
2013-03-24 10:09         ` Michał Górny
2013-03-24 13:40           ` Ulrich Mueller
2013-03-24 14:13             ` Michał Górny
2013-03-24 20:18               ` Zac Medico
2013-03-25 22:42     ` [gentoo-dev] [PATCH] " Michał Górny
2013-03-23 17:44   ` [gentoo-dev] [PATCH 1/2] " Alec Warner
2013-03-23 18:57     ` Michał Górny
2013-03-23 18:57     ` [gentoo-dev] " Jonathan Callen
2013-03-23 19:02       ` Alec Warner [this message]
2013-03-23 16:26 ` [gentoo-dev] [PATCH 2/2] Support wrapping headers for multilib ABIs Michał Górny
2013-03-24 15:14   ` Alexis Ballier
2013-03-24 15:41     ` Michał Górny
2013-03-24 20:01       ` Alexis Ballier
2013-03-25 22:22         ` [gentoo-dev] [PATCH] " Michał Górny
2013-03-23 16:46 ` [gentoo-dev] [PATCHES] Header wrapping support for multilib Diego Elio Pettenò
2013-03-23 17:32   ` Michał Górny
2013-03-23 17:32     ` Diego Elio Pettenò
2013-03-23 19:56   ` [gentoo-dev] [PATCH] Support wrapping headers for multilib ABIs Michał Górny
2013-03-23 20:03     ` Michał Górny
2013-03-23 22:01     ` [gentoo-dev] " Jonathan Callen
2013-04-01  9:19 ` [gentoo-dev] [PATCHES] Header wrapping support for multilib Michał Górny
2013-04-02 10:59   ` Alexis Ballier
2013-04-02 11:47     ` Michał Górny
2013-04-04  8:07       ` Alexis Ballier
2013-04-04 17:53         ` Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAr7Pr_5OtcSiT9nBut=zeFQuoVaqc0QArm9_4_WZhabng4FnA@mail.gmail.com' \
    --to=antarus@gentoo.org \
    --cc=abcd@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=mgorny@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox