I'm buidling my own shell and I was trying to implement a history function, but was a little lost on where to start. I know i would like to use a for loop to go through list, I'm just having trouble on where to store it.
Jump to Post
You could do like
bashand keep it in a 'hidden' file in the user's home directory (
If you want to quickly access past commands, however, you probably want to keep the most recent N commands in memory and only flush them to disk periodically.
All 2 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.