Skip to main content

Module bash

Module bash 

Source
Expand description

Bash history (.bash_history).

Plain one-command-per-line by default. With HISTTIMEFORMAT set, each entry is preceded by a #<unix_epoch> line (Bash manual, Bash History Builtins). Multi-line commands are stored with literal embedded newlines (cmdhist on, default), so a #<digits> line is the only reliable entry boundary — the lines that follow it accumulate into one command until the next boundary.

Functions§

parse
Parse bash history bytes into entries.
parse_timestamp_line
If line is a bash timestamp line (# immediately followed by ≥1 digits and nothing else), return the epoch. Bash writes only the raw integer.