This program is suppose to accept a number from the user and print that many prime numbers. For some reason the program doesn\'t work. I am new to bash scripting and this is my
#!/bin/bash
#
# primes
#
read -p "Enter a number: " n
i=2
for (( i=2; i <= n; i++ ))
do
for (( j=2; j*j < i; j++ ))
do
if ((i % j == 0))
then
echo "no prime, $i divider: "$j
break
fi
done
done
i needs to run to √(n) only.