Add files

This commit is contained in:
G2 2022-10-24 01:06:58 -05:00 committed by GitHub
parent 986e0f7030
commit cbd8cbb1c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 933112 additions and 0 deletions

12
anagram.sh Normal file
View file

@ -0,0 +1,12 @@
#!/bin/bash
word=$1
wordsorted=$(echo $word | grep -o . | sort | tr -d "\n")
lines=$(grep -xin -- "$wordsorted" sortedwords.txt | sed -e 's/:.*//g')
if [[ $lines = "" ]]; then
echo "No matches."
exit 0
fi
readarray -t lines <<<"$lines"
for i in "${lines[@]}"; do
sed "${i}q;d" words.txt | tr '[:upper:]' '[:lower:]'
done

466550
sortedwords.txt Normal file

File diff suppressed because it is too large Load diff

466550
words.txt Normal file

File diff suppressed because it is too large Load diff