#!/bin/sh source _roku_shared.sh roku() { _roku_dispatch "$@" } complete -F __roku_completion roku ############################################################################### # # Logging # LOGDIR="${HOME}/roku/logs" dcapture() { nc minicom "$@" -C $LOGDIR/.log.$(date +%Y-%m-%d--%H-%M-%S) } dfile() { local Nth="-1" if [ $# -gt 0 ]; then Nth="$1" fi echo $(ls -tr -1 ${LOGDIR}/minicom.log.* | tail ${Nth} | head -1) } dless() { less $(lfile "$@") } dcat() { cat $(lfile "$@") } dgrep() { lcat | grep -a --color "$@" } dtail() { if [ $# -gt 0 ]; then tail -f $(lfile) | grep "$@" else tail -f $(lfile) fi }