From 848a848d9dae557ae4f08a4550221c1697e35977 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Tue, 24 Oct 2023 10:45:09 +0200 Subject: [PATCH] Adds examples --- demo.sh => examples/demo1.sh | 0 examples/demo2.sh | 6 ++++++ examples/demo3.sh | 9 +++++++++ examples/demo4.sh | 12 ++++++++++++ 4 files changed, 27 insertions(+) rename demo.sh => examples/demo1.sh (100%) create mode 100755 examples/demo2.sh create mode 100755 examples/demo3.sh create mode 100755 examples/demo4.sh diff --git a/demo.sh b/examples/demo1.sh similarity index 100% rename from demo.sh rename to examples/demo1.sh diff --git a/examples/demo2.sh b/examples/demo2.sh new file mode 100755 index 0000000..7be74e1 --- /dev/null +++ b/examples/demo2.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +for i in `seq 1 100`; do + echo $i + sleep 0.05s +done diff --git a/examples/demo3.sh b/examples/demo3.sh new file mode 100755 index 0000000..286d470 --- /dev/null +++ b/examples/demo3.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +width=$(stty size | cut -d ' ' -f 2) + +for c in a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9; do +for i in `seq 1 $width`; do + echo -n $c +done +done diff --git a/examples/demo4.sh b/examples/demo4.sh new file mode 100755 index 0000000..346f0d3 --- /dev/null +++ b/examples/demo4.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +for i in `seq 1 100`; do + echo -en $i 'Compiling toto\r' + sleep 0.02s + echo -e $i 'Done\x1b[K' + sleep 0.02s + echo -en $i 'Compiling tata\r' + sleep 0.02s + echo -e $i 'Done\x1b[K' + sleep 0.02s +done