help-bash
[Top][All Lists]
Advanced

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

How to check a file's modify time is at epoch 0?


From: Peng Yu
Subject: How to check a file's modify time is at epoch 0?
Date: Sun, 27 Oct 2019 16:34:30 -0500

Hi,

I use the following code to check if 1.txt's modify time is at epoch
0. But it is not very convenient.

set -v
touch -d @0 {0,1}.txt
stat 0.txt
[[ ! 0.txt -nt 1.txt && ! 0.txt -ot 1.txt ]]
echo "$?"

Is there any better way to do so in bash? Thanks.

-- 
Regards,
Peng



reply via email to

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