Documentation
¶
Overview ¶
Package shellhist reads the commands a shell kept in its history file: bash's, zsh's, fish's, a plain sh's and PowerShell's (PSReadLine), with the time each ran where the file records it.
Index ¶
Constants ¶
const ( Bash = "bash" Zsh = "zsh" Fish = "fish" Sh = "sh" PowerShell = "pwsh" )
The shells whose history files are read.
const ( TailBytes = 512 << 10 MaxEntries = 5000 )
TailBytes is how much of the end of a history file is read; MaxEntries how many different commands a history keeps at most, the newest.
Variables ¶
This section is empty.
Functions ¶
func LoginShell ¶
LoginShell names the shell of a login shell's path, "" for none known.
Types ¶
type Entry ¶
Entry is a command of the history: the newest time it ran (zero when its file keeps none), the shell of its file, and how many times the part read holds it.
type File ¶
File is the end of a history file as read: its shell, its bytes, and whether its start was cut, which leaves its first line a part.
type History ¶
History is what a host's history files hold, the newest command first, and the login shell of its user ("" when unknown).
func Merge ¶
Merge is the commands of files, the newest first, each once: where it ran last, with how many times it ran. A command of a file without times takes the time of the last timed one before it in its file, so that the order of each file stays; one with none sorts after the timed.