diff options
| author | Louis Burda <quent.burda@gmail.com> | 2024-05-10 20:02:22 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2024-05-10 20:02:22 +0200 |
| commit | d443cc3152fc206e4393e9809f282722200308ca (patch) | |
| tree | 20d97961c3ef9f2d62a85238d76165eb40757f08 /chall/checker.sh | |
| download | seccon2022-txtchecker-master.tar.gz seccon2022-txtchecker-master.zip | |
Diffstat (limited to 'chall/checker.sh')
| -rw-r--r-- | chall/checker.sh | 9 |
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 |
