Skip to content

Instantly share code, notes, and snippets.

@gioisco
gioisco / bashrc_autobackup.sh
Created November 10, 2022 14:10
An automatic backup of bashrc on load bash and after 10 minutes from the last edit of .bashrc
# START AUTOBACKUP .bashrc
how_old_is_file_from_now() {
if [[ ! -r $1 ]]; then
echo 0
else
echo "$(($(date +%s) - $(date -r "$1" +%s)))"
fi
}
bak_have_same_modify_date() {