Fixed some minor things

This commit is contained in:
G2-Games 2022-10-24 02:27:18 -05:00
parent 73941d6c95
commit 577143b1d4

6
anagram.sh Normal file → Executable file
View file

@ -1,5 +1,9 @@
#!/bin/bash
word=$1
word=$(echo $1 | xargs)
if [[ $word = "" ]]; then
echo "usage: ./anagram.sh <word>"
exit 1
fi
wordsorted=$(echo $word | grep -o . | sort | tr -d "\n")
lines=$(grep -xin -- "$wordsorted" sortedwords.txt | sed -e 's/:.*//g')
if [[ $lines = "" ]]; then