-
Notifications
You must be signed in to change notification settings - Fork 0
man track
track
- pause the script until the file is modified
track [-t|-T TIMEOUT] [-o|-a] [-g|-w] FILE...
Pause the script until the file is modified. Modification is deduced from modification time.
If a file does not exists, it is still tracked; creations and deletions of files still count as modifications.
When multiple files are tracked, two behaviors are possible : resume the script when one file has been modified (OR mode), or when each file has been modified (AND mode).
File name patterns can be matched with the option -g
(or -w
), using the same syntax as globbing, which must be activated (see set +f
and shopt
).
The pattern must be quoted, or it will be expanded before given to the function, and track
won't detect changes like new file creation.
In combination with AND mode, the list of files that must be modified is the expansion of the pattern at the start of the execution.
FILE
: the file(s) to track
-o
, --or
: only one modification is needed (default behavior)
-a
, --and
: every file must be modified
-t
, --timeout
TIMEOUT
: if the time is up, resume the script and return 255
-T
, --delay
TIMEOUT
: same as -t, but do nothing until TIMEOUT is up
-g
, --glob
: activate post globbing
-w
, --wildcard
: alias for -g
0
: if OK (change detected)
1
: if invalid parameters
255
: if interrupted while the conditions weren't fulfilled
track -w "*.txt"
track -w "/dev/sd?"
track -w "/dev/sd[a-z]"
track -w "/dev/sd[^a]*"