Skip to content

Instantly share code, notes, and snippets.

@hirose31
Created February 17, 2011 12:16
Show Gist options
  • Save hirose31/831599 to your computer and use it in GitHub Desktop.
Save hirose31/831599 to your computer and use it in GitHub Desktop.
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