Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnsonjh/isnewer
isnewer: A utility to compare file modification dates; re-implementation of AT&T Research UNIX V8 newer(1)
https://github.com/johnsonjh/isnewer
compare date newer shell unix utility v8
Last synced: 4 days ago
JSON representation
isnewer: A utility to compare file modification dates; re-implementation of AT&T Research UNIX V8 newer(1)
- Host: GitHub
- URL: https://github.com/johnsonjh/isnewer
- Owner: johnsonjh
- License: 0bsd
- Created: 2022-07-17T19:44:14.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-28T15:36:01.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T02:47:25.095Z (27 days ago)
- Topics: compare, date, newer, shell, unix, utility, v8
- Language: Makefile
- Homepage: https://github.com/johnsonjh/isnewer
- Size: 24.4 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# isnewer - compare file modification dates
A free implementation of AT&T Research UNIX V8 `newer(1)`.
## Overview
* It is unfortunately difficult to portably and robustly determine the
newer of two files from a UNIX shell script - the POSIX baseline
[`test(1)`](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html)
does not include the `-nt` and `-ot` operators commonly seen on GNU
and BSD systems. Efforts to update the POSIX specification to include
these and other widely-implemented `test(1)` extensions appears to have
[stalled](https://www.austingroupbugs.net/view.php?id=375).* AT&T Research UNIX V8 (never released under a proper FLOSS license)
from 1985 offers a reasonable precedent, having provided this
functionality via the `newer(1)` shell utility:```
NAME
newer - test file modification datesSYNOPSIS
newer file1 file2DESCRIPTION
Newer yields a zero return code if file1 exists and file2
does not, or if file1 and file2 both exist and file1's
modification time is at least as recent as that of file2.
It yields a non-zero return code otherwise.
```* `isnewer` intends to be compatible with the AT&T Research UNIX V8
`newer(1)` implementation, with the addition of supporting the
following command-line arguments:* `-v` or `--version` - Prints version information to standard error
* `-h` or `--help` - Prints usage information to standard error* These new arguments are exclusive; that is, they may not combined
with each other and may not be used in conjunction with any date
comparisons.* The name `isnewer` was chosen for this package to avoid clashing with
other utilities of the same name that may be provided by operating
systems (*i.e.* Research UNIX V8) or as components of other packages
(*i.e.* some versions of teTeX). Users, system administrators, and
distribution packagers can make use of
[`alternatives`](https://wiki.debian.org/DebianAlternatives) or a
similar facility to provide more convenient access to this utility.## Building
* `isnewer` should work on any POSIX-like system with a C compiler.
* A convenient `Makefile` for building and running tests is provided.## Notes
* No effort is made to utilize sub-second mtime precision
* [mtime comparison considered harmful](https://apenwarr.ca/log/20181113)
(according to some people)## License
* `isnewer` is distributed under the terms and conditions of the
following Zero-Clause BSD (*0BSD*) license.```
Copyright (c) 2022 Jeffrey H. JohnsonPermission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted.THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
```