Need Help with function that has multiple ranges

I have a problem that I cant figure out what to do in this function i need it to count multiple ranges like 0 10, 5 10, 1 100. I know that my counter needs to be outside the function and that it needs to be set to the lowest numbered positional parameter but thats were I am having trouble if anybody can take look at the code and help me out I would appreciate the help.

Here is the code:

#! /bin/bash 

count_up () 
{
  echo "Couting UP"
  n=0 
  until [[ $n -gt $1 ]]
  do
    printf "$n \n" 
    n=$(( $n + 1 )) 
  done 
}

count_down () 
{
  echo "Couting DOWN"
  n=$1
  while [[ $n -gt 0 ]]
  do
    printf "$n \n" 
    n=$(( $n - 1 )) 
  done 
} 

count_up $1
count_down $1
man seq
# seq 3 10
3
4
5
6
7
8
9
10

What is your final goal behind this ? what are you trying to achieve?

Just a quick shot :

# cat tst
#!/usr/bin/bash
start=0
echo "start=$start"

count(){
case $1 in
    -u) let start+=$2;echo "+$2";;
    -d) let start-=$2;echo "-$2";;
    *) echo "Error : first arg should be [-u|-d]
esac
echo "start=$start"
}

count -u 5
count -d 10
count -u 3
count -u 7
count -u 40
count -d 17
# bash tst
start=0
+5
start=5
-10
start=-5
+3
start=-2
+7
start=5
+40
start=45
-17
start=28

My goal is when i run the script to specify the numbers to count between low and high.

Isn't it what the seq command does ? (just as demonstrated above)

Try to enter these commands :

seq 0 10
seq 5 10
seq 1 100

Or could you please provide a full example of what input and output you expect (just as i did) so it may help us to understand your needs and provide a more accurante answer to you.
Thanks

Also when i run the script which i called lab5-4sh and when I want to run the script like this bash lab5-4.sh 1 10 i want it to have this output
$ ./lab5-4sh 1 10
1 2 3 4 5 6 7 8 9 10
10 9 8 7 6 5 4 3 2 1

that is what my goal is

can you help me with that I am a beginner to shell scripting so its hard for me to understand how to write the script

# cat ./lab5-4sh
#!/usr/bin/ksh
[[ $# -ne 2 ]] && echo "error 2 args required" && exit 1
[[ $1 -gt $2 ]] && ( min=$2 ; max=$1 ) || ( min=$1 ; max=$2 )
seq $min $max | xargs
seq $min $max | tail -r | xargs

You may have to enforce the code to check that the $1 and $2 entries are numbers.
as well as find another way to handle the formatting not to depend on MAX_ARGS limitation due to the xargs usage , but it can still be a beginning.

When i put this in my script:

seq 0 10
seq 5 10
seq 1 100

" #! /bin/bash 

count_up () 
{
  echo "Couting UP"
  n=0 
  until [[ $n -gt $1 ]]
  do
    printf "$n \n" 
    n=$(( $n + 1 )) 
  done 
}


count_down () 
{
  echo "Couting DOWN"
  n=$1
  while [[ $n -gt 0 ]]
  do
    printf "$n \n" 
    n=$(( $n - 1 )) 
  done 
} 

count_up $1
count_down $

seq 1 10 
seq 5 10 
seq 1 100 " 

the output that I get when I run the script "bash lab5-4.sh 1 10" i get this:

bash lab5-4.sh 1 10
Couting UP
0 
1 
Couting DOWN
lab5-4.sh: line 19: [[: $: syntax error: operand expected (error token is "$")
1
2
3
4
5
6
7
8
9
10
5
6
7
8
9
10
1
2
3
4
5
...
...
97
98
99
100

and that is not the output that I am trying to get it needs to look like this :