I'm trying to create a script that will get a word(min 3 chars, max 10 chars) as its input then it will reverse the position of the characters.
The question is how to combine operations for the if statements to get this script work.
#!/bin/bash
clear
ok=3
echo *****REVERSE*****
while [ $ok = 3 ]
do
echo "Enter a character: "
read id
if [ ${#id} -eq 3 ]
then
echo $id | rev
elif [ ${#id} -eq 4 ]
then
echo $id | rev
elif [ ${#id} -eq 5 ]
then
echo $id | rev
else
echo Minimum character is 3 and Maximum is 5!Logging out..
ok=4
fi
done