@Buvanesh_Kumar,
You didn’t paid attention to what i said. You have to logout/reboot/shutdown machine.
It is must/compulsory to logout/reboot/shutdown the machine.
Run the script again, then logout atleast. Login again and check.
Let me know what you are getting.
First, I tried to test the script is working or not, by executing the script. Its failure in testing. Then how I can use this script in other tasks. Now my aim is not erasing history in startup/restart/logout. Just run the script then it will erase history. That’s all
(sorry if my English is poor to understand)
This is not possible as far as i know. why?
You need to learn interpretation of history command with bash shell.
Also concentrate on how .bash_history file is written.
It is compulsory to logout/reboot/shutdown after running the above script.
Whats the error message you are getting when you run the script.
I have myself tested this and it works quiet well. Post what is the error you are getting when you run the script.
Time is a variable which is used in file name to generate unique file name everytime based upon today’s date and time.
You may notice a new file created created as .bash_history_2015_… in your home folder. This file contains a backup of your history, in case you want to see it in future.
Each time you run the script/script run automatically, a file will be created automatically. To see all those files run
$ ls -l ~/.bash_history*
If you don’t want this feature comment out two lines from the above scripts. Just put a hash at the beginning of the below two lines simply as