So I'm trying to implement a history command in a mini shell using c. histPut should be storing the ten most recent commands in my histList. I'm supposed to be able to recall a command in the command line by inputting r x, where x is the first char of whatever command I want, and then histGet will search through the history and grab the first command whose first char matches my input.
I want to be able to review when a command was executed as well as the syntax of the command. I have exported HISTTIMEFORMAT='%F %T ' . I then execute the history command: history | grep "cp /etc" . The result (last ~15 lines) is displayed below. The earliest time/date displayed is my most recent login time/date, not the time/date of when the command was executed.