From c0a33acff6f93e825de0d0aa3f7045ca220fb040 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Mon, 24 Jul 2023 15:11:08 +0300 Subject: [PATCH] impoved output line by line mode --- executor.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/executor.sh b/executor.sh index ba88bd2..5225cae 100755 --- a/executor.sh +++ b/executor.sh @@ -17,7 +17,9 @@ if [ -f access_denied/"$remote_ip" ]; then exit 0; fi session_established=0 generator_session=$(zcat -f $system_dict | shuf -n 2 | tr -d "\n'") randpadding=$(head -c 8 /dev/urandom | base64) -printf "$randpadding\t$generator_session\n" +printf "$randpadding\t$generator_session\n" + +rewrite_line() { printf "\r\033[1A\033[0K%s" "$@"; } while read -r cmd mesg; do if [ "$cmd" = "reg" ]; then @@ -51,7 +53,9 @@ while read -r cmd mesg; do tlhome=$(timeline_home "$mesg") tlhome_len=$(echo "$tlhome" | wc -l) current_pos=1 + echo "-- tl home view ($tlhome_len lines)--" while read -r cursor; do + rewrite_line if [ ':q' = "$cursor" ]; then break; fi if [ ':all' = "$cursor" ]; then echo "$tlhome"; break; fi echo "$tlhome" | awk "NR==$current_pos"