Skip to content
Kenichi Kamiya edited this page Jan 29, 2025 · 3 revisions

Shell

How to inspect implementation of shell functions?

https://unix.stackexchange.com/questions/59537/display-the-function-body-in-bash

declare -f <cmd>

which only works in zsh, delcare -f works in both zsh and bash.

zsh: corrupt history file $HISTFILE

Remove the broken line. What is the broken? With your feeling...!

cp "$HISTFILE" "$(mktemp --directory zsh-history-backup.XXXX)"
hx "$HISTFILE" "+$(<"$HISTFILE" wc --lines)"
Clone this wiki locally