File: D1382.prompt_command-histcmd.sh

package info (click to toggle)
ble.sh 0.4.0~git20250321.d4c812b-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,516 kB
  • sloc: sh: 71,367; awk: 1,316; cpp: 750; ansic: 186; javascript: 43; makefile: 35
file content (8 lines) | stat: -rw-r--r-- 246 bytes parent folder | download
1
2
3
4
5
6
7
8

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