Okay, so I been trying to figure this problem for a while and I'm coming up with errors left and right. This is my first time trying to learn the basics. So any advice would be helpful! Problem: I'm trying to write a Bash shell script program that prompts for and reads two integers from the user.  The second argument is assumed to be greater than the first.  The output of the program is a counting of numbers beginning at the first number and ending with the second number. In other words the output would look like this:     Please enter the first number:    3    Please enter the second number, larger than the first:    6    3    4    5    6Okay, so this is what I have so far~     read -p Please Enter the first number :  n1     echo $n1   read -p Please Enter the second number, larger than the first :  n2     echo $n2   FIRSTV=0   SECONDV=1   if [ 1 -gt 0]   then   count=$((FIRSTV-SECONDV))   echo $COUNT   fi
Bash shell script program that prompts for and reads two integers from the user.
bash;shell;shell script;centos;arithmetic
If you can use seq, you could do this:read -p Please Enter the first number :  n1echo $n1read -p Please Enter the second number, larger than the first :  n2echo $n2seq $n1 $n2If you have to do it entirely in shell and can use a modern shell like bash, ksh, zsh etc (but not ash or dash or similar strictly POSIX shell), you could replace the seq command with:eval printf '%s\n' {$n1..$n2}You need to use eval for the second version because bash/ksh/etc sequences expect actual integers like {1..5}, not variables like {$n1..$n2}.  eval expands the variables so that their actual values are used inside the {...} sequence.if you want to do it with a loop and no fancy bash/ksh/etc features, you could replace the seq or eval lines with something like:c=$n1while [ $c -le $n2 ] ; do    echo $c    c=$((c+1))doneThis works in any POSIX-compatible shell, including dash and ash, as well as bash etc.