sistema_progs

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

D0702.bashrc (637B)


      1 # bashrc -*- mode: sh; mode: sh-bash -*-
      2 
      3 function measure1 {
      4   time1=($(date +'%s %N'))
      5 }
      6 function measure2 {
      7   local -a time2=($(date +'%s %N'))
      8   local sec=$((time2[0]-time1[0]))
      9   local usec=$((sec*1000000+10#${time2[1]}/1000-10#${time1[1]}/1000))
     10   echo "${usec} us" >/dev/tty
     11 }
     12 
     13 function taisaku1 {
     14   count=($(history 1))
     15   echo count=${count[0]}
     16   ((HISTSIZE=count*2))
     17 }
     18 
     19 cp memo/D0702.HISTFILE.100k A.txt
     20 export HISTFILE=A.txt
     21 export HISTSIZE=100000
     22 export HISTFILESIZE=100000
     23 shopt -s histappend
     24 bleopt_history_lazyload=
     25 
     26 # 履歴の読み込み
     27 history -n
     28 #source ../ble-dev/out/ble.sh
     29 
     30 taisaku1
     31 measure1
     32 PS1='$(measure2)'$PS1