2024-02-03 14:01:11 +01:00
|
|
|
#!/bin/bash
|
2024-02-03 14:21:38 +01:00
|
|
|
FILE="./array-sorter"
|
2024-02-03 14:01:11 +01:00
|
|
|
|
|
|
|
echo {1..300} > ./numbers.txt
|
|
|
|
cat ./numbers.txt | tr ' ' "\\n" | shuf | tr "\\n" ' ' > ./random.txt
|
2024-02-03 14:21:38 +01:00
|
|
|
if test -f ./array-sorter; then
|
|
|
|
echo "$FILE exists, running"
|
|
|
|
|
|
|
|
else
|
|
|
|
echo "$FILE doesn't exist, building"
|
|
|
|
go build -o $FILE .
|
|
|
|
fi
|
|
|
|
./array-sorter $(cat ./random.txt)
|