summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@firemail.cc>2023-07-30 19:19:58 +0530
committersinanmohd <sinan@firemail.cc>2023-07-30 19:20:06 +0530
commitae5c63b653aaa60ca15e83e821c47802578d0814 (patch)
tree3779dec4be2a634de693a7bd87886ef09a9cd690
parentc82316419babd2af9e7ef5bf11a5bbd1e8d672d1 (diff)
ctov: fix: plain and application mime prefix on different $file implementationHEADmaster
-rwxr-xr-xbin/ctov.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/ctov.sh b/bin/ctov.sh
index 018b70c..10b8d33 100755
--- a/bin/ctov.sh
+++ b/bin/ctov.sh
@@ -69,9 +69,11 @@ while getopts "hf:" f; do
esac
done
-if [ -n "$file" ] &&
- [ "$(file --brief --dereference --mime-type "$file")" != "application/csv" ]; then
- die "input is not a csv file"
+if [ -n "$file" ]; then
+ case "$(file --brief --dereference --mime-type "$file")" in
+ *"/csv") ;;
+ *) die "input is not a csv file" ;;
+ esac
fi
while read -r entry; do