coreutils
[Top][All Lists]
Advanced

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

Re: date does not support pipes


From: Chris Elvidge
Subject: Re: date does not support pipes
Date: Sat, 13 Jan 2024 12:18:19 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Lightning/5.4

On 13/01/2024 04: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"; }

Instead of:

stat --format "%Y" check.txt | date

This is inconvenient.

Would it be possible to implement reading from stdin in date?

Best,
Philip




date -r check.txt ?

--
Chris Elvidge
England




reply via email to

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