Sha256: a3e195197a9d440c9ff31690a4aa88d198824b38fa16c0a6f3824a778f444d66
Contents?: true
Size: 564 Bytes
Versions: 117
Compression:
Stored size: 564 Bytes
Contents
#! /bin/bash if [ "$#" -ne 2 ]; then echo "Usage: $0 <string1> <string2>" >&2 exit 1 fi input="$1" possibles="$2" out="" in_counts="$(echo $input | tr '[:upper:]' '[:lower:]' | fold -w1 | sort | uniq -c)" for possible in $possibles do p_counts="$(echo $possible | tr '[:upper:]' '[:lower:]' | fold -w1 | sort | uniq -c)" if test "$in_counts" = "$p_counts" -a "$(echo $input | tr '[:upper:]' '[:lower:]')" != "$(echo $possible | tr '[:upper:]' '[:lower:]')" then out="${out} ${possible}" fi done echo ${out# } #strip leading spaces
Version data entries
117 entries across 117 versions & 1 rubygems