I want to store a user message in a bash program, and then display the message the next time the user runs the script.
One way I thought this might work is if I export the message to an environmental variable, but I cannot get it to work.
Here is what I have so far, but it is not working:
echo "Last message was: $KEEPTHISMESSAGE"
echo "Type the new message that you want to enter, followed by [ENTER]:"
read KEEPTHISMESSAGE
export KEEPTHISMESSAGE
What am I doing wrong? If there is a better way to do this, please let me know. Maybe keep a file that keeps a history of these message and gets the most recent?