coreutils
[Top][All Lists]
Advanced

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

date does not support pipes


From: Philip Rogers
Subject: date does not support pipes
Date: Sat, 13 Jan 2024 05:14:25 +0100
User-agent: Mozilla Thunderbird

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




reply via email to

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