From 46345060aa9414aad838acad2af11176fa094891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Thu, 22 Jul 2021 11:26:23 +0200 Subject: Rename to when This is to resolve the name conflict with another program called watch, which is for watching command output. --- when.1 | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 when.1 (limited to 'when.1') diff --git a/when.1 b/when.1 new file mode 100644 index 0000000..2362bf2 --- /dev/null +++ b/when.1 @@ -0,0 +1,50 @@ +.Dd $Mdocdate$ +.Dt WHEN 1 +.Os +.Sh NAME +.Nm when +.Nd a simple file watcher +. +.Sh SYNPOSIS +.Nm when +.Op Fl i +.Ar file ... +. +.Sh DESCRIPTION +.Pp +.Nm when +is a simple program that watches any given +.Ar file +for changes. +When the file changes, its name (as specified in the arguments to +.Nm when ) +is printed on standard output. +.Pp +If the +.Fl i +argument is provided, an initial such line is printed when the program +starts, before beginning to watch for changes. +. +.Sh ERRORS +.Pp +If one of the watched files is deleted, a message is printed on standard +error and the program exits with error code 1. +.Pp +If a file is renamed, a notice is printed on standard error, but the +program keeps running. +. +.Sh EXAMPLES +.Bd -literal -offset indent +when * | xargs -I% cp % /mnt/usb/ +.Ed +.Bd -literal -offset indent +when -i *.ms | while read f; do + make "${f%.ms}".pdf && kill -HUP mupdf +done +.Ed +. +.Sh AUTHORS +.Pp +.Nm when +is written by +.An John Ankarström Aq Mt "john (at) ankarstrom.se" . -- cgit v1.2.3