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