When I abandoned the Korn shell for bash many years ago, I was never able to fully convert some interactive scripts that maintained their own history file allowing recall of previous entries. Scouring the archives, I was delighted to find Matthew Cengia's post* from 2013 that shows how to do it.
He ends with the question, "I'm not sure whether there's a better way to append to the history file than the echo above; hopefully somebody else can improve on that." No one did, at least not threaded to his post. I don't have any old Korn shell scripts to confirm, but IIRC, the Korn shell's read command had this capability built in, although you still had to play with HISTFILE, so I ask if it's reasonable to have bash's read command do the same to avoid having to do the echo dance. * http://lists.gnu.org/archive/html/help-bash/2013-02/msg00001.html --Ken Nellis