I'm currently working on my own replica of the history builtin.
I realize I need the HISTSIZE, HISTFILE and HISTFILESIZE variables to achieve the command options but I don't know how to get them. Is there a function similar to getenv or a variable like environ but with the local shell variables ?
Thanks in advance !
Well a builtin is executed directly by the shell for 2 possible reasons:
A shell could only provide access to its internal variables by two ways:
AFAIK, no common shell implement either, but you can export the required shell variables to the environment:
export HIST export HISTSIZE export HISTFILESIZE
should be enough to later get them through