summaryrefslogtreecommitdiffstats
path: root/chall/checker.sh
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2024-05-10 20:02:22 +0200
committerLouis Burda <quent.burda@gmail.com>2024-05-10 20:02:22 +0200
commitd443cc3152fc206e4393e9809f282722200308ca (patch)
tree20d97961c3ef9f2d62a85238d76165eb40757f08 /chall/checker.sh
downloadseccon2022-txtchecker-master.tar.gz
seccon2022-txtchecker-master.zip
Add solutionHEADmaster
Diffstat (limited to 'chall/checker.sh')
-rw-r--r--chall/checker.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/chall/checker.sh b/chall/checker.sh
new file mode 100644
index 0000000..45f7942
--- /dev/null
+++ b/chall/checker.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+read -p "Input a file path: " filepath
+file $filepath 2>/dev/null | grep -q "ASCII text" 2>/dev/null
+
+# TODO: print the result the above command.
+# $? == 0 -> It's a text file.
+# $? != 0 -> It's not a text file.
+exit 0