This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INPUT_FILE=$1 | |
# Check if target file is set | |
if [ -z "$2" ] | |
then | |
# Ask confirmation before overwriting the existing file | |
read -p "Overwrite the existing ${INPUT_FILE} (y/N)? " | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then | |
TARGET_FILE=$INPUT_FILE | |
else |