#!/bin/bash
#run as: 
#        bash a.sh 2 1 3 4 5 6 7 8 10 
#                     or 
#       bash a.sh 1 2 3 4 5 6 7 8 10

my_function () {
echo $x $y
if [[ $y -le $x ]]; then 
 msg="second less than equal first"
 echo ok
 return 0
fi
 return 1
}

echo $1 $2 $3 $4 $5 $6 $7 $8 $9
x=$1
y=$2
echo $#
my_function

if [[ $? -eq 0 ]]; then
	echo "error: $?"
 	echo $msg
else
 	let z=$2+$3+$4+$5+$6+$7+$8+$9
 	echo $z
fi
