I'm not totally sure what you're asking. Do you want to supply a parameter, and loop over the values from 1 to that value? If so, you can do this with bash (and probably other shells as well:
function test() {
for ((i = 1; i <= $1; ++i)); do
echo $i
done
}
test 12
1
2
3
4
5
6
7
8
9
10
11
12
If you don't have a shell that supports the for(...) syntax, you can do the same thing with:
function test() {
i=1
while [ $i -le $1 ]; do
echo $i
i=$(expr $i + 1)
done
}