From 08806316cc8116fb252999ab7b04126d8cecdfd6 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 28 Dec 2012 23:30:38 +0900 Subject: [PATCH] add func clock --- bashrc | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index 66f7814..ba117dc 100755 --- a/bashrc +++ b/bashrc @@ -248,7 +248,20 @@ fi alias setup.py="sudo python3 setup.py install --record files.txt" -man() { +clock(){ + ( + local tformat="%Y/%m/%d %H:%M:%S %z" + local t= + while true + do + t="`date "+${tformat}"`" + printf "\\r$t" + sleep 1 + done + ) +} + +man(){ env \ LESS_TERMCAP_mb=$(printf "\e[1;35m") \ LESS_TERMCAP_md=$(printf "\e[1;31m") \ @@ -261,8 +274,8 @@ man() { } scr(){ - _tformat="%Y%m%d-%H%M%S%z" - _file=`date +${_tformat}`.script + local _tformat="%Y%m%d-%H%M%S%z" + local _file=`date +${_tformat}`.script SCRIPT=${_file} script ${_file} "$@" }