Fix primes bound on shell scripts
This commit is contained in:
parent
da579f08af
commit
12733ba5c6
|
@ -8,6 +8,8 @@ for i in `seq 2 $num`; do
|
|||
nums+=($i)
|
||||
done
|
||||
|
||||
unset nums[-1]
|
||||
|
||||
while [ -n "$nums" ]; do
|
||||
prime=${nums[0]}
|
||||
echo $prime
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
read -P "" num
|
||||
echo
|
||||
|
||||
set nums (seq 2 $num)
|
||||
set nums (seq 2 $num)[..-2]
|
||||
|
||||
while test -n "$nums"
|
||||
set prime $nums[1]
|
||||
|
|
Loading…
Reference in a new issue