cowgill / spamhaus

A shell script that grabs the latest Spamhaus DROP List and adds it to iptables.
50 stars 21 forks source link

Improvement : awk '!/^;/{print $1}' drop.lasso better than cat grep awk #5

Open supersophie opened 6 years ago

supersophie commented 6 years ago

Hi,

On line 49, save yourself two processes. Use this instead. You don't need the cat and grep. We can do this with just awk, e.g

awk '!/^;/{print $1}' $FILE

Ciao,Sophie

supersophie commented 6 years ago

Final line equals:

# iterate through all known spamming hosts
for IP in $(  awk '!/^;/{print $1}' ); do