diff options
author | John <john@ankarstrom.se> | 2019-03-03 13:28:43 +0100 |
---|---|---|
committer | John <john@ankarstrom.se> | 2019-03-03 13:28:43 +0100 |
commit | 82852ce2fafe3fe3c2b8fbee77b2f10cc0067c2e (patch) | |
tree | 45cb0ae373f91242e491f39b02b650e3a797f774 /watch.1 | |
parent | 15fc4542704e9e3bb3f31f7eae911b483db42a53 (diff) | |
download | when-82852ce2fafe3fe3c2b8fbee77b2f10cc0067c2e.tar.gz |
add support for multiple files
Diffstat (limited to 'watch.1')
-rw-r--r-- | watch.1 | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -8,11 +8,11 @@ .Sh SYNPOSIS .Nm watch .Op Fl i -.Ar file +.Ar file ... .\" .Sh DESCRIPTION .Nm watch -is a simple OpenBSD program that watches a given +is a simple OpenBSD program that watches any given .Ar file for changes. When the file changes, its name (as specified in the arguments to @@ -21,25 +21,29 @@ is printed on standard output. If the .Fl i -argument is provided, an initial such line is printed when the -program starts, before beginning to watch for changes. +argument is provided, an initial such line is printed when the program +starts, before beginning to watch for changes. .Nm watch exits on SIGINT (C-c). .\" .Sh ERRORS -If the watched file is deleted, a message is printed on standard +If one of the watched files is deleted, a message is printed on standard error and the program exits with error code 1. -If the file is renamed, a notice is printed on standard error, but -the program keeps running. +If a file is renamed, a notice is printed on standard error, but the +program keeps running. .\" .Sh EXAMPLES .Bd -literal -offset indent -watch document.ms | while read; do - make document.pdf && kill -9 mupdf +$ watch *.ms | while read file; do + make ${file%.ms}.pdf && kill -9 mupdf done .Ed +.Bd -literal -offset indent +$ alias each='xargs -L0 -I {}' +$ watch -i * | each cp {} /mnt/usb/ +.Ed .\" .Sh AUTHORS .Nm watch |