#!/usr/bin/env bash set -e encode_name() { local name="$1" local result="test_" if [[ ! "$name" =~ [^[:alnum:]\ _-] ]]; then name="${name//_/-5f}" name="${name//-/-2d}" name="${name// /_}" result="$result$name" else local length="${#name}" local char i for ((i=0; i