can any of you tell me what is shell's problem in this case?
When I write and execute this script(./cyklus.sh 5 10
):
1 #!/bin/bash
2
3
4 if [ $# -eq 2 ]; then
5 if [ $1 -le $2 ]; then
6 for i in {$1..$2}
7 do
8 if [ $i -lt $2 ]; then
9 echo -n "$i "
10 else
11 echo "$i"
12 fi
13 done
14 elif [ $1 -gt $2 ]; then
15 echo "Prvy argument musi byt vacsi nez druhy."
16 fi
17 else
18 echo "Nezadal si 2 argumenty"
19 fi
it outputs an error:
./cyklus.sh: line 8: [: {5..10}: integer expression expected
{5..10}
even though the starting and ending integer is set there through $1 and $2.