#!/usr/bin/env bash

input=$1

reversed=""
length=${#input}

for (( i=$length-1; i>=0; i-- )); do
    # extract each character from input
    # and append it to reversed 
    reversed="${reversed}${input:$i:1}"
done

echo "$reversed"