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


Groups > gnu.bash.bug > #16468

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

From Eli Schwartz <eschwartz@archlinux.org>
Newsgroups gnu.bash.bug
Subject Re: Undocumented feature: Unnamed fifo '<(:)'
Date 2020-06-28 12:06 -0400
Message-ID <mailman.560.1593360391.2574.bug-bash@gnu.org> (permalink)
References <20200628134945.GB24863@medium.hauri> <CANaoh6KSJS8X73Zqj7M8TT6_gAOjGraZx1EaEVwUNN_=Yya3wQ@mail.gmail.com> <d1172623-25cb-bcf9-b9b5-b7bf3cb547f7@archlinux.org>

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 6/28/20 11:55 AM, Dennis Williamson wrote:
> How is running your
> 
>         echo >&9 $_string
>         read -t 1 -u 8 _out
> 
> many times better than running your
> 
>    _out=$(date -d "$_string" +%s)
> 
> many times?
> 
> Why don't you just use a function?
> 
> date_to_epoch () {
>     date -d "$1" +%s
> }
> 
> _out=$(date_to_epoch "$_string")

You seem to be suggesting that a dedicated function will reduce
boilerplate commands, resulting in more readable code.

You COMPLETELY failed to even read the reporter's message, which
specifically stated "In order to reduce forks and make some tasks a lot
quicker [...]"

Very plainly, the reporter does not care how much code is used, but does
care that $() forks a process. It's literally the entire point of the
discussion: to replace forking with redirection to fifos.

Now, you can argue that this should or should not be a goal, but it's
quite silly to conflate the goal with "your goal could be achieved by
using a function".

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

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


Thread

Re: Undocumented feature: Unnamed fifo '<(:)' Eli Schwartz <eschwartz@archlinux.org> - 2020-06-28 12:06 -0400

csiph-web