#!/usr/bin/env bash set -eu for record in $(../../this-interpreter --variety minimal-a; ../../this-interpreter --variety minimal-b) do pyver=$(echo "$record" | awk -F'%' ' { print $1 }') python=$(echo "$record" | awk -F'%' ' { print $2 }') rm -rf save-dir-$pyver mkdir -p save-dir-$pyver export hn=$(hostname) find $(pwd)/to-be-saved -name .svn -prune -o -print0 | \ ( $python ../../bin/backshift --save-directory "save-dir-$pyver" --backup --hostname $hn --subset test --init-savedir $python ../../bin/backshift --save-directory "save-dir-$pyver" --backup --hostname $hn --subset test $python ../../bin/backshift --save-directory "save-dir-$pyver" --backup --hostname $hn --subset test $python ../../bin/backshift --save-directory "save-dir-$pyver" --backup --hostname $hn --subset test $python ../../bin/backshift --save-directory "save-dir-$pyver" --backup --hostname $hn --subset test ) list_of_backups=$( $python ../../bin/backshift --save-directory "save-dir-$pyver" --list-backups 2>&1 ) if [ $(echo "$list_of_backups" | wc -l) != 5 ] then ( echo "$0: Bad number of lines:" echo "$list_of_backups" ) 1>&2 exit 1 fi if [ "$(echo "$list_of_backups" | awk ' { print NF }' | sort | uniq)" != 4 ] then ( echo "$0: Bad number of fields:" echo "$list_of_backups" ) 1>&2 exit 1 fi done