We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c82d0a9 commit 03afc2dCopy full SHA for 03afc2d
1 file changed
Lab6/validate.sh
@@ -13,6 +13,20 @@ cp $solution_path/ans .
13
cp $solution_path/chal .
14
cp $solution_path/*.txt .
15
16
+if [ "$1" -eq 1 ]; then
17
+ if grep -q "[^a-zA-Z0-9]" 1.txt; then
18
+ echo "[!] 1.txt contains non-alphanumeric characters."
19
+ exit 1
20
+ fi
21
+fi
22
+
23
+if [ "$1" -eq 2 ]; then
24
+ if ! grep -q "[^[:print:]]" 2.txt; then
25
+ echo "[!] 2.txt must contain at least one non-printable character."
26
27
28
29
30
make run$1 > out
31
result=$(diff --strip-trailing-cr ans out)
32
if [[ -n $result ]]; then
0 commit comments