A Random Bashing - primes

Etusivu
Liitteet:
Viesti alkuperäisessä muodossaan
+ (text/plain)
Poista viesti
Vastaa
Lähettäjä: Ben Trussell
Päiväys:  
Vastaanottaja: Main PLUG discussion list
Aihe: A Random Bashing - primes
A Random Act of Bashing... Find all primes between <arg1> and <arg2>
(expects/assumes integer values) and print to sdtout..

-------
#!/bin/bash

for (( a=$1; a<=$2; a++ ))
do
        n=`factor $a|awk '{print $NF}'`
        if [ $a == $n ]
        then
                echo $a
        fi
done
-------


EOF

- Ben
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss