14 lines
317 B
Bash
Executable File
14 lines
317 B
Bash
Executable File
#!/bin/bash
|
|
FILE="./array-sorter"
|
|
|
|
echo {1..300} > /tmp/numbers.txt
|
|
cat /tmp/numbers.txt | tr ' ' "\\n" | shuf | tr "\\n" ' ' > /tmp/random.txt
|
|
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 /tmp/random.txt)
|