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: Mon, 29 Jun 2020 08:06:15 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 6/29/20 6:06 AM, Robert Elz wrote:
> Perhaps, but that would be a bizarre way to accomplish that.   I got
> the impression that the assumption was that there would somehow be just
> one fork, no matter how many times the conversion was required.   I
> think that might be possible using bash - but not using date(1) to do
> the conversions, it would need a purpose written command which read date
> specs from stdin and wrote time_t's (in decimal) to stdout.

If we are going with purpose-written commands I'd advise the OP to write
a bash loadable builtin for date. There is already a strftime one, but
it only lets you convert an epoch to an arbitrary format.

And once we are in bash loadable builtins land, one can also add an
option to save the output into a bash variable (like printf -v) instead
of printing it to stdout. There are a couple of example loadable
builtins that do this sort of thing already.

No forks involved, not even one for the lifetime of the script.

-- 
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]