training-utils/historytailzsh

21 строка
387 B
Plaintext
Исходник Постоянная ссылка Обычный вид История

2012-08-30 09:20:00 +04:00
#!/bin/sh
#Ensure we have the quantity specified on the CLI
if [ -z "$2" ]; then ARG_ERR=ERR; fi
if [ -z "$1" ]; then ARG_ERR=ERR; fi
if [ -n "$ARG_ERR" ];
then
echo "Usage: <sleeptimesecs> <numberoflines>"
exit
fi
sleeptimesecs=$1
numberoflines=$2
# Tail history
while [ 1 ]; do
clear
tail -$numberoflines ~/.zsh_history | sed s/^.*\;//
2012-08-30 09:20:00 +04:00
sleep $sleeptimesecs
done