1

cant figure out the error in this script (adding numbers in a string) using ubantu shell

view story
linux-howto

http://www.unix.com – hii please help me this is the script Code: num=$1 sum=0 while [$num -ne 0] do x=`expr $num % 10` sum=`expr $sum + $x` num=`expr $num / 10` done echo "Summation is $sum" it is giving error pratyush@ubuntu:~$ sh shell.sh 123 shell.sh: 11: 123: not found Summation is 0 please help!!! (HowTos)