days 11/16: remove faulty use of external command (seq)

This commit is contained in:
2021-07-30 19:21:16 +02:00
parent 9c60bd6d12
commit 92cc3e90c4
8 changed files with 34 additions and 34 deletions

View File

@@ -1,16 +1,16 @@
ex1.bash : res=2386
time: 0:41.94 real, 41.86 user, 0.03 sys
context-switch: 4503+14, page-faults: 0+1329
time: 0:33.55 real, 33.12 user, 0.42 sys
context-switch: 179+18, page-faults: 0+1948
ex1-c : res=2386
time: 0:00.01 real, 0.01 user, 0.00 sys
context-switch: 1+1, page-faults: 0+91
time: 0:00.00 real, 0.00 user, 0.00 sys
context-switch: 0+1, page-faults: 0+90
ex2.bash : res=2091
time: 1:20.09 real, 80.00 user, 0.03 sys
context-switch: 8232+13, page-faults: 0+1721
time: 1:08.60 real, 68.56 user, 0.02 sys
context-switch: 530+10, page-faults: 0+1480
ex2-c : res=2091
time: 0:00.01 real, 0.01 user, 0.00 sys
context-switch: 2+1, page-faults: 0+91
context-switch: 6+1, page-faults: 0+90

View File

@@ -107,7 +107,8 @@ NROWS=${#rowsstr[@]}
#echo "L=$RLENGTH N=$NROWS"
# add floor rows at beginning and end
printf -v floor '%0.s0 ' $(seq 1 $((RLENGTH+2)))
printf -v floor '%0.s0 ' $(eval "echo {1..$((RLENGTH+2))}")
#echo floor="$floor"
#echo floor="$floor"
#echo

View File

@@ -84,8 +84,7 @@ done
NCOLS=${#rowsstr[0]}
NROWS=${#rowsstr[@]}
printf -v zeroed '%0.s0 ' $(seq 1 $(((NCOLS+2)*(NROWS+2))))
printf -v zeroed '%0.s0 ' $(eval "echo {1..$(((NCOLS+2)*(NROWS+2)))}")
# split arrays in integers
for ((r=0; r<NROWS; ++r)); do

View File

@@ -162,7 +162,7 @@ NCOLS=${#rowsstr[0]}
NROWS=${#rowsstr[@]}
SIZE=$((NCOLS * NROWS))
printf -v zeroed '%0.s0 ' $(seq 1 $SIZE)
printf -v zeroed '%0.s0 ' $(eval "echo {1.. $SIZE}")
# split arrays in integers
for ((r=0; r<NROWS; ++r)); do