3 if [ "$#" -ne 1 ]; then
4 echo This script checks the input file to verify that it is sorted
5 echo "$0 <manifest.csv>"
12 if [ $retval -ne 0 ]; then
14 echo "[ERROR] $1 is not properly sorted. Please sort it with the following commands:"
16 echo " LC_ALL=C sort < $1 > $1.tmp"
21 # check that there are no duplicate records
22 DUPLICATES=$(rev < $1 | cut -f2- -d, | uniq -d | rev | tr ',' ':')
23 for DUP in $DUPLICATES; do
24 echo "[ERROR] $DUP has duplicate entries"