Implement Command watch
Objective
Have a command, watch, which does the following
help page
BusyBox v1.24.1 (2016-02-19 11:20:55 SGT) multi-call binary.
Usage: watch [-n SEC] [-t] PROG ARGS
Run PROG periodically
-n Loop period in seconds (default 2)
-t Don't print header
Done
- When the command complies with the above interface
- When it can be compiled as an applet into the slimbox binary
Demo
Show each command as an 'applet', and that it conforms to the interface:
$ slimbox watch --help
BusyBox v1.24.1 (2016-02-19 11:20:55 SGT) multi-call binary.
Usage: watch [-n SEC] [-t] PROG ARGS
...
Show that when called as a symlink, the same happens
$ ln -s slimbox watch
$ ./watch --help
BusyBox v1.24.1 (2016-02-19 11:20:55 SGT) multi-call binary.
Usage: watch [-n SEC] [-t] PROG ARGS
...