changing long options with short options and K&R style

This commit is contained in:
Leo 2018-09-09 21:11:43 -06:00
commit a23f46249d
2 changed files with 6 additions and 8 deletions

View file

@ -1,16 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# TODO: Find a less trashy way to get the next available error code # TODO: Find a less trashy way to get the next available error code
if ! shopt -s globstar; then if ! shopt -s globstar
then
echo "Error: This script depends on Bash 4." >&2 echo "Error: This script depends on Bash 4." >&2
exit 1 exit 1
fi fi
for i in 1 2; do for i in 1 2
last=$(grep --no-filename --invert-match "^prop" ./**/*.hs \ do
| grep --extended-regexp --word-regexp --only-matching "$i[0-9]{3}" \ last=$(grep -hv "^prop" ./**/*.hs | grep -Ewo "$i[0-9]{3}" | sort -n | tail -n 1)
| sort --numeric-sort \
| tail --lines 1
)
echo "Next ${i}xxx: $((last+1))" echo "Next ${i}xxx: $((last+1))"
done done

View file

@ -16,7 +16,7 @@ if [[ $var == *$'\nTrue'* ]]
then then
exit 0 exit 0
else else
grep --context 3 --regexp "Fail" --regexp "Tracing" <<< "${var}" grep -C 3 -e "Fail" -e "Tracing" <<< "${var}"
exit 1 exit 1
fi fi
) 2>&1 ) 2>&1