I have been bashing my head to write a simple history script for the last two days. History is a shell-built in command I couldn't able to use that within a BASH script. So, Is there a way attain this using BASH script ?
Here we go my script for you:
#!/bin/bash history | tail -100 > /tmp/history.log cd /tmp uuencode history.log history.txt | mail -s "History log of server" email@example.com