On 2024-01-12 20:14, Philip Rogers wrote:
> Hi,
> 
> `date` seems not to support reading from stdin.
> 
> So if you want the "last data modification" date of a file, in ISO8601 format 
> at the seconds level, you have to:
> 
> stat --format "%Y" check.txt | { read ts; date -d@"$ts"; }

You want process substitution:

  date -d@$(stat --format "%Y" check.txt)

It's too easy to interpolate the numeric time into the date
command line. Even if we are doing fork + exec in C,
it's just a snprintf job to produce a "-d@12345..."
argument.


Reply via email to