commit 0e11225a775979a1c42c9b7881f250e2a0092c13
Author:     Jan Klemkow <[email protected]>
AuthorDate: Sun May 3 22:37:40 2020 +0200
Commit:     Jan Klemkow <[email protected]>
CommitDate: Sun May 3 22:37:40 2020 +0200

    perf: auto detect seq(1) and jot(1)
    
    makes perf.sh more portable

diff --git a/perf.sh b/perf.sh
index 7b86378..b6d514c 100755
--- a/perf.sh
+++ b/perf.sh
@@ -3,21 +3,26 @@
 set -eu
 
 num=1000000
+seq=seq
+
+if [ -x /usr/bin/jot ]; then
+       seq=jot
+fi
 
 rm -f perf_*.log
 
-for i in `jot 10`; do
+for i in `$seq 10`; do
        /usr/bin/time st -e                      jot $num 2>>perf_0.log
 done
 
-for i in `jot 10`; do
+for i in `$seq 10`; do
        /usr/bin/time st -e ./ptty               jot $num 2>>perf_1.log
 done
 
-for i in `jot 10`; do
+for i in `$seq 10`; do
        /usr/bin/time st -e ./ptty ./ptty        jot $num 2>>perf_2.log
 done
 
-for i in `jot 10`; do
+for i in `$seq 10`; do
        /usr/bin/time st -e ./ptty ./ptty ./ptty jot $num 2>>perf_3.log
 done

Reply via email to