sistema_progs

Programas para customizar o meu entorno de traballo nos meus equipos persoais
Log | Files | Refs

D1120.measure.sh (1076B)


      1 #!/bin/bash
      2 
      3 _initialize() {
      4   : >| D1119.measure.out
      5   echo "builtin history -c" >| D1119.measure._read_r
      6   echo "builtin history -c" >| D1119.measure._read_s
      7   local N=$1
      8   echo "builtin history -r /dev/stdin <<__BLE_EOF__" >> D1119.measure._read_r
      9   for ((i=0;i<N;i++)); do
     10     command="echo hello $RANDOM world abcdefg this is a test"
     11     echo "$command" >> D1119.measure.out
     12     echo "builtin history -s -- '$command'" >> D1119.measure._read_s
     13     echo "$command" >> D1119.measure._read_r
     14   done
     15   echo "__BLE_EOF__" >> D1119.measure._read_r
     16   echo "builtin history -a /dev/null" >> D1119.measure._read_r
     17   echo "builtin history -a /dev/null" >> D1119.measure._read_s
     18 }
     19 
     20 _read_r() {
     21   builtin history -c
     22   source D1119.measure._read_r
     23   builtin history -a /dev/null
     24 }
     25 _read_s() {
     26   builtin history -c
     27   source D1119.measure._read_s
     28   builtin history -a /dev/null
     29 }
     30 
     31 function measure1 {
     32   local HISTCONTROL= HISTIGNORE=
     33   #for N in 1 2 5 10 20 50 100; do
     34   for N in {6..9}; do
     35     _initialize $N
     36     ble-measure "_read_r $N"
     37     ble-measure "_read_s $N"
     38   done
     39 }
     40 measure1