Clarification: Am not looking to destroy
history
, am looking for means to periodically purge it vialaunchd
for security purposes
Have been using cat /dev/null > ~/.bash_history
to clear bash history as have seen in many *nix conversations as the most effective way to do so.
So I put it into a shell script that runs in launchd
, yet after some time I've come to realize though it runs it's not clearing history.
Is it possible to clear bash history this way via bash script or can it only be done manually as a user? Perhaps I need to run the command directly in the .plist and not via a bash script?
Note: I have other scripts running correctly via launchd so question is strictly about being able to clear history via an agent
Thank you
Update: Found this cool site that helps generate
launchd
scripts if this helps anyone. Cannot vouch for it but it's much easier than hacking XML. It seems to usesh -c
for all commands though, so not sure why that is.launchd plist generator http://launched.zerowidth.com/
launchd
, you should take a look atLaunchControl
. It's not free, but it's brilliant, and well worth the modest price. After using it for a few weeks, you'll realize thatlaunchd
actually is useful!