From b305db8c52fa1a68957e72104d82a4541801b87f Mon Sep 17 00:00:00 2001 From: akanealw Date: Sun, 31 Mar 2024 18:26:29 -0500 Subject: [PATCH] added cpb bash command --- debian/debian-essentials.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/debian/debian-essentials.sh b/debian/debian-essentials.sh index 8ecbb9f..a3ff0dc 100755 --- a/debian/debian-essentials.sh +++ b/debian/debian-essentials.sh @@ -179,6 +179,22 @@ if [[ -f /etc/apt/keyrings/docker.gpg ]] echo "alias lzd='lazydocker'" >> /etc/bash.bashrc fi +# create copy of file before editing +if [[ ! -f /usr/local/bin/cpb ]]; then +cat <<'EOF' >> /usr/local/bin/cpb +#!/bin/bash + +if [ $# -eq 1 ] +then + cp -pvi "$1" "${1}.bak" +else + echo "Info: $0 copies to a backup file" + echo "Usage: $0 " +fi +EOF +chmod +x /usr/local/bin/cpb +fi + # create tmux config rm /etc/tmux.conf* > /dev/null 2>&1 echo "unbind C-b" >> /etc/tmux.conf