#!/bin/bash [ "$(id -u)" -ne 0 ] && echo 'root privilege required' && exit 1 BASEDIR=$PWD [ ! "$BASEDIR" == '/opt/miaou-bash' ] && echo 'should be installed in /opt/miaou-bash directory' && exit 1 ORIGINAL="ORIGINAL" declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc) for i in "${arr[@]}"; do if [ -f "$i.$ORIGINAL" ]; then echo "uninstalling $i" rm "$i" mv "$i.$ORIGINAL" "$i" else echo "$i" not overriden fi done