[Top][All Lists]

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

Re: Should -et be available?

From: Chris F.A. Johnson
Subject: Re: Should -et be available?
Date: Sun, 24 May 2020 19:00:43 -0400 (EDT)
User-agent: Alpine 2.21 (DEB 202 2017-01-01)

On Sun, 24 May 2020, Peng Yu wrote:

I don't find a way to test whether two files are at the same time.
Should there be a switch for this comparison given -nt and -ot are
available? Thanks.

      file1 -nt file2
             True if file1 is newer (according to modification date)
than file2, or if file1 exists and file2 does not.
      file1 -ot file2
             True if file1 is older than file2, or if file2 exists
and file1 does not.

 Use both tests. If it is neither older nor newer, then it is the same.

   Chris F.A. Johnson                         <>
   =========================== Author: ===============================
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
   Pro Bash Programming: Scripting the GNU/Linux shell (2009, Apress)

reply via email to

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