text2gopher - scripts - random scripts
HTML git clone https://git.parazyd.org/scripts
DIR Log
DIR Files
DIR Refs
---
text2gopher (332B)
---
1 #!/bin/sh
2
3 if [ -z "$1" ]; then
4 printf "usage: %s filename|extension" "$(basename "$0")"
5 exit 1
6 fi
7
8 ext="$(printf "%s" "$1" | awk -F. '{print $NF}')"
9
10 case "$ext" in
11 jpg|jpeg|JPG|JPEG|png|PNG)
12 echo "I"
13 ;;
14 gif|GIF)
15 echo "g"
16 ;;
17 txt|TXT|vtt|VTT|vt|VT|ebuild|sh|c|md|html|HTML|css)
18 echo "0"
19 ;;
20 *)
21 echo "9"
22 ;;
23 esac