counter / increment problem within echo stmt

Simple script trying to increment a counter within an echo statement never gets past 1 - PLEASE HELP!

Thanks.


\#!/bin/sh
stepup\(\)
\{
  STEP=\`expr $STEP \+ 1\`
  echo $STEP
\}

\#
\#  Initialize variables
\#
STEP=0

 echo "Counter Value: \`stepup\`"
 echo "Counter Value: \`stepup\`"
 echo "Counter Value: \`stepup\`"
 echo "Counter Value: \`stepup\`"
 echo "Counter Value: \`stepup\`"
 echo "Counter Value: \`stepup\`"
 echo "Counter Value: \`stepup\`"
 echo "Counter Value: \`stepup\`"
 echo "Counter Value: \`stepup\`"
 echo "Counter Value: \`stepup\`"

the problem is that your function "stepup" gets evaluated at the beginning of execution. I would do something like this instead:

#!/bin/sh

stepup()
{
let STEP=$1+1
echo $STEP
}

STEP=0

STEP=`stepup $STEP`
echo "Counter: $STEP"
STEP=`stepup $STEP`
echo "Counter: $STEP"
STEP=`stepup $STEP`
echo "Counter: $STEP"
STEP=`stepup $STEP`

Is there any way to evaluate the function "stepup" and echo/print it out in one statement or are we stuck doing 2 separate statements - one to evaluate the function and another to display it. Is there a way to do it within the function (ie, return)?

Thanks.