This is a little frustrating, and I'm sure there's an easy answer.
history(max.show=N)
will display N lines of history on to the terminal. savehistory(file)
will save a number of lines of history to a file, depending on some environment variable. What I would like to do is
savehistory(file, max.show=N)
To do this in one line instead of having to copy or trawl through a history file for the lines I want would make things much easier.
Is there a quick function/way to save a specified number of lines to a specified file?