Created
October 10, 2015 11:45
-
-
Save hilotech/045f53f894f97625b56d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: (cat /etc/fstab && sleep 20 && cat /etc/fstab ) | ./test.sh | |
interval=10 | |
function _do() { | |
echo "$@" | cat -n | |
} | |
CR=' | |
' | |
while true | |
do | |
buffer='' | |
while read -t ${interval-} line | |
do | |
buffer="${buffer-}${line-}${CR-}" | |
done | |
if [[ -z "${buffer-}" ]]; then | |
continue | |
fi | |
_do "${buffer-}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment