So, i want to filter some values using awk, to insert them to the file after this so that they don't appear in the script file, for this im trying to use system grep function
and im getting this output everytime i use the script
/sbin/ufw deny from 187.210.68.101
to any
/sbin/ufw deny from 45.88.221.190
to any
/sbin/ufw deny from 5.253.235.40
to any
but i need
/sbin/ufw deny from 187.210.68.101 to any
/sbin/ufw deny from 45.88.221.190 to any
/sbin/ufw deny from 5.253.235.40 to any
also, my 4 string is getting removed
lines brokes everytime
awk '{ if (system("grep -L "$1" banned.txt")) print "/sbin/ufw deny from "$1 to any" "; }' /usr/local/test/susp.txt >> /usr/local/test/script.sh
Im trying to fix it of course, so that the ufw deny rule is displayed on the same line with all arguments without any bugs, and does not output anywhere there banned.txt because it shouldn't be written there