Skip to content

Instantly share code, notes, and snippets.

@0xTenable
Created March 5, 2016 21:51
Show Gist options
  • Save 0xTenable/8694cf6bd079b7057955 to your computer and use it in GitHub Desktop.
Save 0xTenable/8694cf6bd079b7057955 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Script to test all options for PA4
count=0
args=(-h -u -d -D -c -i -s -S -x -sc)
inputfile="test.txt"
echo "\n------------------- BEGIN SCRIPT ---------------------"
for option in "${args[@]}"
do
echo "\n------------- TEST $count Option: $option -----------------\n"
~/../public/pa4test "${option}" "${inputfile}" &> s
./myuniq "${option}" "${inputfile}" &> o
DIFF=$(diff s o)
if [ "$DIFF" == "" ]
then
echo "TEST PASSED"
else
echo "${DIFF}"
fi
count=$(expr $count + 1)
done
echo "\n------------------- END SCRIPT ---------------------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment