First you need to create a .nshrc file (or .zshrc for ZSH) in your users home directory. This may be "c:\users\<user>" on Windows or just "~/" on Unix. Once the file has been created place the following content inside:
# number of lines kept in history
# number of lines saved in the history after logout
# location of history
# append command to history file once executed
Save the file .nshrc file with the above content. Next create the via the file as defined in HISTFILE variable, this can be done use the touch command or manually created with a text editor. Now when the NSH shell next starts it will save command history to the file HISTFILE and this will persist across sessions.
- BMC BladeLogic Server Automation Suite