#!/bin/bash
read n
sd=0
rev=0
if[[ $n -lt 0 ]];
then
echo "Not a positive number"
else
while [[ $n -gt 0 ]]
do
sd=$(( $n % 10 ))
rev=`expr $rev \* 10 + $sd`
n=$(( $n /10 ))
done
echo $rev
./scriptprog4.sh: line 6: if[[ 123 -lt 0 ]]: command not found
./scriptprog4.sh: line 7: syntax error near unexpected token then'
./scriptprog4.sh: line 7:then'
