fast-replace/bash-fast-replace/bin/test.sh

20 lines
364 B
Bash
Executable File

#! /bin/bash
# Tests a file called replaced.csv
BASE=$(dirname $(dirname $(realpath -s $0)));
REPLACED_FILE="$BASE/csv/replaced.csv"
if [ ! -f "$REPLACED_FILE" ]; then
echo "File not found: $REPLACED_FILE"
echo "Generate replacements first."
exit 1;
fi
if [[ `cat "$REPLACED_FILE"` =~ [0-9] ]]; then
echo 'test NOK'
exit 1
else
echo 'test OK'
exit 0
fi