]> piware.de Git - bin.git/commitdiff
shellpresent: typing emulation master
authorMartin Pitt <martin@piware.de>
Mon, 28 Sep 2026 10:01:48 +0000 (12:01 +0200)
committerMartin Pitt <martin@piware.de>
Mon, 28 Sep 2026 13:13:17 +0000 (15:13 +0200)
shellpresent

index fcf1ba073197f6c19342dd2b6e98fea7dead3cf8..8c2c48bc63ab49f3b1dd6e50a745cee979bfa04d 100755 (executable)
@@ -57,7 +57,10 @@ while IFS= read -r line <&3; do
     fi
 
     # execute command
-    echo -n "$line"
+    for ((i = 0; i < ${#line}; i++)); do
+       printf '%s' "${line:i:1}"
+       sleep "0.0$((10 + RANDOM % 26))"
+    done
     read
     echo -ne "\e[${OUTPUT}m"
     eval "$line" 3<&-