#!/bin/bash hs="$1" len=${#hs} echo "# ciphers: $((len/4))" mapfile="etc/cipher-mapping.txt" [ -s $mapfile ] || mapfile="../$mapfile" [ -s $mapfile ] || exit 255 cip="" first=true for ((i=0; i $grepstr --> " cip=$(grep -i ${grepstr} $mapfile | awk '{ print $3 }') echo $cip if "$first"; then ciphers="$cip" first=false else ciphers="$ciphers:$cip" fi done echo echo $ciphers