Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # straight outta fub
- printf "Starting Point [SPACE] Ending Point: "
- read -r starting ending
- IsPrime=1
- while [ $starting -le $ending ]
- do
- iteration=2
- IsPrime=1
- while [ $iteration -lt $starting ]
- do
- if [ `expr $starting % $iteration` -eq 0 ]
- then
- IsPrime=0
- break
- fi
- iteration=`expr $iteration + 1`
- done
- if [ $IsPrime -eq 1 ]
- then
- printf "$starting "
- fi
- starting=`expr $starting + 1`
- done
- echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement