Skip to content

Instantly share code, notes, and snippets.

@shellscriptx
Last active February 28, 2019 13:26
Show Gist options
  • Save shellscriptx/bb2dec9110058ffbf19eacfb2f937adf to your computer and use it in GitHub Desktop.
Save shellscriptx/bb2dec9110058ffbf19eacfb2f937adf to your computer and use it in GitHub Desktop.

Função

ver_log()
{
    while read -r linha; do
        IFS=' ' read _ _ hora _ <<< $linha
        [[ $hora = $1 || $hora = $2   ]] ||
        [[ $hora > $1 && $hora < $2   ]] && echo "$linha"
    done < arq.log
}

Uso:

ver_log <hora_inicial> <hora_final>

Exemplo:

ver_log 13:30:00 22:00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment