bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eli Schwartz
Subject: Re: Undocumented feature: Unnamed fifo '<(:)'
Date: Sun, 28 Jun 2020 12:06:10 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]