Created
February 17, 2011 12:16
-
-
Save hirose31/831599 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
taitailf() { | |
ff= | |
for f in "$@"; do | |
case $f in | |
*/*) ;; | |
*) f=/service/$f/log/main/current ;; | |
esac | |
[ -r "$f" ] || { echo "[ERROR] cannot open: $f"; return 1; } | |
ff="$ff $f" | |
done | |
tail -F $ff | tai64nlocal | |
} | |
# bash completion | |
_daemons() { | |
local cur | |
cur=${COMP_WORDS[$COMP_CWORD]} | |
WORDS=$(ls -1 /service) | |
COMPREPLY=( $(compgen -W "$WORDS" -- "$cur") ) | |
} | |
complete -F _daemons taitailf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment