From fced211a6f817c7950aeedeebec1fc955041ef40 Mon Sep 17 00:00:00 2001 From: Laurent Ghigonis Date: Fri, 8 Mar 2013 00:15:09 +0100 Subject: conf/bashrc: add now(), prepends date to tailed new lines usage: tail -F test.log |now tail -F test.log |now "[%d/%b/%Y %H:%M:%S %z]" --- conf/bashrc | 1 + 1 file changed, 1 insertion(+) (limited to 'conf') diff --git a/conf/bashrc b/conf/bashrc index cf0a874..87f34d7 100644 --- a/conf/bashrc +++ b/conf/bashrc @@ -70,6 +70,7 @@ alias usee='vim ~/perso/USEFULL_COMMANDS' alias xbindkeys-reload="pkill xbindkeys; xbindkeys" alias tn='tmux new-session -s' alias ta='tmux attach' +function now() { while read line; do echo -ne "`date ${1:++"$1"}` $line\n"; done } function htod() { echo "ibase=16; $1" | bc; } function dtoh() { echo "obase=16; $1" | bc; } -- cgit v1.2.3-59-g8ed1b