1 2 3 4 5 6 7 8 9 10 11 12 13
get_type() { FILE="$1" CATEGORY="$(echo "$FILE" | grep -Eo "\.[0-9].?\.html$")" if [ -n "$CATEGORY" ]; then case "$CATEGORY" in .1*) echo "Command" ;; .2*) echo "Service" ;; .3*) echo "Function" ;; *) echo "Object" ;; esac fi }