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.
shaneetra.graham
0
Newbie Poster
Recommended Answers
Jump to PostYou could do like
bash
and keep it in a 'hidden' file in the user's home directory (bash
uses~/.bash_history
).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
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.