The command history feature is available in command mode.
isql -Uguest -Ppassword -Smyase --history p1024 --history_file myaseHistory.log <<EOF exec sp_x_y_z go EOF
Command history contains the most recent commands issued in an isql session. When history_length is reached, isql drops the oldest command from the history and adds the newest command issued.
If you do not specify an alternate log file, and if the $HOME or %APPDATA% environment variable used by the default log file is not defined, an error message appears and the command history log is not saved.
In an isql session, use the h [n] command to display the command history. A page can display up to 24 lines of commands. If the command history contains more than 24 lines, press Enter to display the next set of commands or enter “a” to display all commands in one page. Enter “q” to return to isql.
Use the ? n | ?? command to recall and reissue a command from the command history.
When n is positive, isql looks for the command labeled with the number n and loads this to the command buffer. When n is negative, isql loads the nth most recent command issued.
?? – recalls the latest command issued and is equivalent to ? -1.
When a command is recalled from history, the recalled command overwrites the command in the command buffer.
You can edit a recalled command before resubmitting the command to the server.