1 2 3 4 5 6 7 8 9 10 |
#!/bin/bash echo "Introduce una palabra o frase" read frase esarf="" for ((i=$((${#frase}-1));i>=0;i--)) { esarf=${esarf}${frase:$i:1} } echo "'${frase}' al reves es '${esarf}'" |
1 2 3 4 5 6 7 8 9 10 |
#!/bin/bash echo "Introduce una palabra o frase" read frase esarf="" for ((i=$((${#frase}-1));i>=0;i--)) { esarf=${esarf}${frase:$i:1} } echo "'${frase}' al reves es '${esarf}'" |