summaryrefslogtreecommitdiffstats
path: root/chall/checker.sh
diff options
context:
space:
mode:
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