mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2024-11-26 04:59:38 +01:00
palindrome.bash: initial commit
This commit is contained in:
parent
9437d3fa56
commit
ba3e15cbcb
13
bash/palindrome.bash
Executable file
13
bash/palindrome.bash
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
# Neovim complains about mangling backslashes if -r is not specified and
|
||||||
|
# I have learned to listen to its warnings
|
||||||
|
read -rp "What would you like to check for a palindrome?: " inputted
|
||||||
|
reversed=$(echo "$inputted" | rev)
|
||||||
|
echo "$reversed"
|
||||||
|
|
||||||
|
if [[ $inputted == "$reversed" ]]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user