#!/bin/bash echo "Enter a number" read no while [ $no -gt 0 ] do add=`expr $no % 10` sum=`expr $sum + $add` no=`expr $no / 10` done echo "sum of theno is "$sum