Reputation: 17
My script code is
history > a.txt
but this does not store anything in the text file. However when I use the command in prompt it works.
I am working with a KornShell (ksh) script on UNIX.
Upvotes: 1
Views: 2543
Reputation: 121387
'history' command is disabled outside the command line (like your script). You can enable it using:
set -o history
Now the command 'history' will be available to your script.
Upvotes: 1