SIGN IN SIGN UP
koalaman / shellcheck UNCLAIMED

ShellCheck, a static analysis tool for shell scripts

39175 0 0 Haskell
#!/usr/bin/env bash
2016-12-10 10:57:01 -08:00
# TODO: Find a less trashy way to get the next available error code
if ! shopt -s globstar
then
echo "Error: This script depends on Bash 4." >&2
exit 1
fi
2016-12-10 10:57:01 -08:00
for i in 1 2 3
2016-12-10 10:57:01 -08:00
do
last=$(grep -hv "^prop" ./**/*.hs | grep -Ewo "${i}[0-9]{3}" | sort -n | tail -n 1)
2016-12-10 10:57:01 -08:00
echo "Next ${i}xxx: $((last+1))"
done