This repository has been archived on 2024-03-04. You can view files and clone it, but cannot push or open issues or pull requests.
linux/.config/bash/module/Watch.sh

25 lines
373 B
Bash
Raw Normal View History

2023-12-07 04:06:05 +03:00
# Watch command output with 2 seconds interval.
2023-12-07 00:42:06 +03:00
# Usage: w <COMMAND>
2023-12-07 01:44:42 +03:00
function w() {
2023-12-07 04:02:47 +03:00
if [[ "${*}" = "" ]]; then
help w
return 2
fi
2023-12-07 00:42:06 +03:00
watch -n 2 "${@}"
}
# Watch command output with minimal interval.
# Usage: ww <COMMAND>
2023-12-07 01:44:42 +03:00
function ww() {
2023-12-07 04:02:47 +03:00
if [[ "${*}" = "" ]]; then
help ww
return 2
fi
2023-12-07 00:42:06 +03:00
watch -n 0 "${@}"
}
2023-10-23 03:31:00 +03:00
# autocomplete.
complete -F _autocomplete_nested w ww