summaryrefslogtreecommitdiffstats
path: root/bin/test
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-05-31 22:57:04 +0000
committerjilles <jilles@FreeBSD.org>2013-05-31 22:57:04 +0000
commit772c877e7b062cfc4d7136ef851c2eccae56df97 (patch)
treeba136dbd068f6223d6b8a39db521236f4e7eef71 /bin/test
parenta275d9449124f17f07c9161f72ffc670999c3488 (diff)
downloadFreeBSD-src-772c877e7b062cfc4d7136ef851c2eccae56df97.zip
FreeBSD-src-772c877e7b062cfc4d7136ef851c2eccae56df97.tar.gz
test(1): Add information about replacing -nt/-ot.
Diffstat (limited to 'bin/test')
-rw-r--r--bin/test/test.116
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/test/test.1 b/bin/test/test.1
index 56ced83..136ee57 100644
--- a/bin/test/test.1
+++ b/bin/test/test.1
@@ -331,6 +331,20 @@ missing.
.It >1
An error occurred.
.El
+.Sh EXAMPLES
+Implement
+.Li test FILE1 -nt FILE2
+using only
+.Tn POSIX
+functionality:
+.Pp
+.Dl test -n \&"$(find -L -- FILE1 -prune -newer FILE2 2>/dev/null)\&"
+.Pp
+This can be modified using non-standard
+.Xr find 1
+primaries like
+.Cm -newerca
+to compare other timestamps.
.Sh COMPATIBILITY
For compatibility with some other implementations,
the
@@ -341,7 +355,9 @@ with the same meaning.
.Sh SEE ALSO
.Xr builtin 1 ,
.Xr expr 1 ,
+.Xr find 1 ,
.Xr sh 1 ,
+.Xr stat 1 ,
.Xr symlink 7
.Sh STANDARDS
The
OpenPOWER on IntegriCloud