Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16469

Re: Undocumented feature: Unnamed fifo '<(:)'

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Oğuz <oguzismailuysal@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: Undocumented feature: Unnamed fifo '<(:)'
Date Sun, 28 Jun 2020 19:31:53 +0300
Lines 68
Approved bug-bash@gnu.org
Message-ID <mailman.562.1593361918.2574.bug-bash@gnu.org> (permalink)
References <20200628134945.GB24863@medium.hauri> <CAH7i3LqDuo5WO-3+md3Mo1qyKuvzkswLtezqFXG=WgmNjneH0Q@mail.gmail.com>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
X-Trace usenet.stanford.edu 1593361919 27267 209.51.188.17 (28 Jun 2020 16:31:59 GMT)
X-Complaints-To action@cs.stanford.edu
Cc "bug-bash@gnu.org" <bug-bash@gnu.org>
To felix <felix@f-hauri.ch>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yquSsPF8rdz8BxAL8cmBRW7A/2Qz0DDk0vnb4Ylfm+E=; b=LYFoVLLcHQA3nFaU5cvRk9u4T+kGCDdGEPtv9szWfOXvjbKB/QxM5eDZYTD0CA84Aj MmaUhDh06HIbsFyaVG5adT88QSBkKSlqkuwVC+ysgupekpi43oL3pjK5WkSJQ9ZhdnXe YdQ2faw4jbW95HjzjziXGxTdEK1IhsToDC8Ug0AKUBqBNHXi4umoE4MmrBzz5TURXjGY kkm3Dha/goDuUT/oWwYPNBRI0XI5BAih09CYdoJ9vRYhISuy25Zzm5i9TA21wLYqscMF aULXMoEscOcd/VOwQyQQuz8oTOVUURGNhfaCs2ccSDtfR0Hy+eUbB6GjIYDuByKB7BPh XLdw==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yquSsPF8rdz8BxAL8cmBRW7A/2Qz0DDk0vnb4Ylfm+E=; b=HNAiYe35uNuL0Br/TYYX2jMbAezP4XaFKERhoZhMBIoJmXlLdaYXqGvx40giXTUriG 9p/6vB3B/wXKf6+3yEWOXtHfRwsyTIgG9av5xuCMivX/909eT8+3+72SJy7UADjLWi1H FcUGI37wcB3//Gjr1duYO+3CJdT/PTSRMABrKLs/QUADBXJjpt36aQvuovWj3lIa4bq8 5nhARNfslcV0tQyk9s7+06BSMoHmtdOxLh87eW/wUBTapkqwRo1bAXK7ezr0fgZ6/Asa gjf4JnSMKXpugFy/J9QdOocEb34mvp8Z6y/pSpVBCJBlWhGFUE7ekTC6R3ALwPdbXSeV 2B7A==
X-Gm-Message-State AOAM531QSmuMnXv4SpoRZyDDTFq6gBE2Bywskq+oGBg78kcG7SfgNMx0 buMqn9X/k5eJ9GzI4yQVYM9vfzgSutz0kxuOu3TcXgt1
X-Google-Smtp-Source ABdhPJyophI92XbADot3KASYW1iHojQQUFyHmRIC6VY+LFBHoSYqzGOTi1mdLfdl6mabxGrJ1aimAYbsy6kSjshvf9w=
X-Received by 2002:ae9:ea13:: with SMTP id f19mr5911383qkg.331.1593361913675; Sun, 28 Jun 2020 09:31:53 -0700 (PDT)
In-Reply-To <20200628134945.GB24863@medium.hauri>
Received-SPF pass client-ip=2607:f8b0:4864:20::734; envelope-from=oguzismailuysal@gmail.com; helo=mail-qk1-x734.google.com
X-detected-operating-system by eggs.gnu.org: No matching host in p0f cache. That's all we know.
X-Spam_score_int -20
X-Spam_score -2.1
X-Spam_bar --
X-Spam_report (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN
X-Spam_action no action
X-Content-Filtered-By Mailman/MimeDel 2.1.23
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <CAH7i3LqDuo5WO-3+md3Mo1qyKuvzkswLtezqFXG=WgmNjneH0Q@mail.gmail.com>
X-Mailman-Original-References <20200628134945.GB24863@medium.hauri>
Xref csiph.com gnu.bash.bug:16469

Show key headers only | View raw


28 Haziran 2020 Pazar tarihinde felix <felix@f-hauri.ch> yazdı:

> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/bash-2bxm7h/bash-5.0=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wall
> -Wno-parentheses -Wno-format-security
> uname output: Linux medium 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2
> (2020-04-29) x86_64 GNU/Linux
> Machine Type: x86_64-pc-linux-gnu
>
> Bash Versions: 3.2.57(1)-release, 5.0.3(1)-release, 5.1.0(1)-alpha
>
> In order to reduce forks and make some tasks a lot quicker, I run
> forked filters as background tasks, with dedicated I/O fd.
>
> For sample, to convert human datetime to UNIX SECONDS, instead of running
>    _out=$(date -d "$_string" +%s)
> many time in same script, I run something like:
>
>     _fifo=$(mktemp -u /tmp/fifo-XXXXXXXX)
>     mkfifo $_fifo
>     exec 9> >(exec stdbuf -o0 date -f - +%s >$_fifo 2>&1)
>     exec 8<$_fifo
>     rm $_fifo
>
> Then to convert human datetime to UNIX SECONDS:
>
>         echo >&9 $_string
>         read -t 1 -u 8 _out
>
> become a lot quicker!
>
> But I recently discovered another way for this:
>
>     exec 8<> <(:)
>     exec 9> >(exec stdbuf -o0 date -f - +%s >&8 2>&8)
>
> usable in same way:
>
>         echo >&9 $_string
>         read -t 1 -u 8 _out
>
> maybe a little more quicker...


Seems like a bug to me. The FIFO created for <(:) shouldn't be writable.


>
> This was tested using https://f-hauri.ch/vrac/date1fork-demo.sh under
> latest version of bash: 5.1.0(1), debian stable version: 5.0.3(1) and
> old 3.2: 3.2.57(1).
>
> There is maybe something to document or even create a new feature
> about open2 and open3...
>
> (I will have to rewrite https://f-hauri.ch/vrac/shell_connector.sh.txt ;)
>
> --
>  Félix Hauri  -  <felix@f-hauri.ch>  -  http://www.f-hauri.ch
>
>

-- 
Oğuz

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: Undocumented feature: Unnamed fifo '<(:)' Oğuz <oguzismailuysal@gmail.com> - 2020-06-28 19:31 +0300

csiph-web