如何用shell实现只让部分字符动,剩下不动?

#!/bin/bash
hello()
{
echo -e " num is $i \r "
}
for i in {1…1000}
do

hello $i
done

我想让 num is 不动,只让 $1 不停地动。但是失败了,老是换行。

#!/bin/bash

hello() {
  echo -ne "\r num is $i "
}

for i in {1..10}; do
  hello $i
  sleep 1
done