sistema_progs

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

D1382.prompt_command-histcmd.sh (246B)


      1 
      2 _histcmd='\!'
      3 print-histcmd() {
      4   local history_histcmd=$(history 1 | cut -d ' ' -f 1)
      5   echo "histcmd=$HISTCMD;${_histcmd@P};$history_histcmd lineno=$LINENO;${BASH_LINENO[-1]}(${#BASH_LINENO[@]})"
      6 }
      7 unset HISTCMD
      8 PROMPT_COMMAND='print-histcmd'