ansitest/sysadmin-bkp-edit.sh

13 lines
236 B
Bash
Raw Normal View History

2024-03-14 09:39:10 -06:00
#!/bin/bash
# Backup critical file before editing (in current dir)
# 2024.Mar kneutron
cp -v "$1" "$1.bkp.$(date +%Y%m%d@%H%M%S)--edit-by-$(id -un)"
2024-03-14 09:39:10 -06:00
ls -lh "$1*"
echo "Backed up $1 - OK to edit - Press enter"
read -n 1
$EDITOR "$1"