Created
November 17, 2015 23:41
-
-
Save lon9/2a2c203424968483fed7 to your computer and use it in GitHub Desktop.
Streaming AA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CMD_NAME=`basename $0` | |
SPACE=`tput cols` | |
FILE_NAME= | |
if [ $# -ne 1 ]; then | |
echo "USAGE: $CMD_NAME file_name" | |
exit 1 | |
fi | |
trap 'tput smam; exit 1' 1 2 3 15 | |
FILE_NAME=$1 | |
while [ $SPACE -gt 0 ]; | |
do | |
while IFS='' read LINE | |
do | |
[[ $SPACE > 0 ]] && printf "%${SPACE}s" ' ' | |
tput rmam; printf "%s\n" "$LINE" | |
done < $FILE_NAME | |
SPACE=$(( SPACE - 1 )) | |
sleep 0.02 | |
if [ $SPACE -gt 0 ]; then | |
clear | |
fi | |
done | |
tput smam |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment