i have this assignment.. and i mad this script but there is something wrong with it.. if anyone can tell me.. watz going on... i would appreciate it.. tHnX in advance..
count=1
val=$2
op=$1
ans=0
if [ $op = "-e" -o $op = "-o" ]
then
if [ $op = "-e" ]
then
while [ $count -le $val ]
do
ans=`expr $count % 2`
if [ $ans -eq 0 ]
then
echo "$count \c "
count=`expr $count + 1`
fi
done
elif [ $op = "-o" ]
then
while [ $count -le $val ]
do
ans=`expr $count % 2`
if [ $ans -ne 0 ]
then
echo "$count \c "
count=`expr $count + 1`
fi
done
fi
else
while [ $count -le $val ]
do
echo "$count \c "
count=`expr $count + 1`
done
fi
ThnX again
added code tags for readability --oombera