aboutsummaryrefslogtreecommitdiff
WHEN(1) General Commands Manual WHEN(1)

whena simple file watcher

when [-i] file ...

when is a simple program that watches any given file for changes. When the file changes, its name (as specified in the arguments to when) is printed on standard output.

If the -i argument is provided, an initial such line is printed when the program starts, before beginning to watch for changes.

If one of the watched files is deleted, a message is printed on standard error and the program exits with error code 1.

If a file is renamed, a notice is printed on standard error, but the program keeps running.

when * | xargs -I% cp % /mnt/usb/
when -i *.ms | while read f; do
	make "${f%.ms}".pdf && kill -HUP mupdf
done

when is written by John Ankarström <john (at) ankarstrom.se>.

July 22, 2021 OpenBSD 7.2