scripts

random scripts
git clone https://git.parazyd.org/scripts
Log | Files | Refs

commit 0c1b24ac7fdbfdd272644ba47cfe8fdd973868e9
parent 933852ecce46bffbae79861a41c6213a2440105e
Author: parazyd <parazyd@dyne.org>
Date:   Tue, 19 May 2020 02:28:04 +0200

Add ext2gopher.

Diffstat:
Aext2gopher | 23+++++++++++++++++++++++
1 file changed, 23 insertions(+), 0 deletions(-)

diff --git a/ext2gopher b/ext2gopher @@ -0,0 +1,23 @@ +#!/bin/sh + +if [ -z "$1" ]; then + printf "usage: %s filename|extension" "$(basename "$0")" + exit 1 +fi + +ext="$(printf "%s" "$1" | awk -F. '{print $NF}')" + +case "$ext" in + jpg|jpeg|JPG|JPEG|png|PNG) + echo "I" + ;; + gif|GIF) + echo "g" + ;; + txt|TXT|vtt|VTT|vt|VT|ebuild|sh|c|md|html|HTML|css) + echo "0" + ;; + *) + echo "9" + ;; +esac