Circle-Packings/fractal_dimension/circle_counting_new/driver.sh

24 lines
543 B
Bash
Raw Permalink Normal View History

#!/bin/bash
cmd="./target/release/circle_counting dimension"
2022-04-28 16:46:50 -07:00
flags="--max=$1 --n=100 --time --debug"
for dir in $(find data -type d)
do
echo $dir | sed -e "s/data/output$1/" | xargs mkdir
done
count=0
total=$(find data -type f | wc -l)
for file in $(find data -type f)
do
newfile=$(echo $file | sed -e "s/data/output$1/")
if test -f $newfile; then
echo "$newfile already exists"
else
$cmd $file $flags | tee $newfile
fi
count=$(($count + 1))
echo "$(bc <<< "(100 * $count) / $total")% done"
done