Here’s a short script to remove multiple ip6fw rules sharing the same number.
for a in `ip6fw list $1 | cut –d ' ' –f 1` do ip6fw delete $1; echo "ip6fw: deleted rule $1"; done
Usage:
# sh rmrules.sh 123
Use the toolbox Did you mean ip6fw delete $a? Otherwise it doesn't make much sense?
ip6fw delete $a
In any case, try this: ip6fw list $1 | cut -d' ' -f1 | xargs -rtn1 ip6fw delete
ip6fw list $1 | cut -d' ' -f1 | xargs -rtn1 ip6fw delete
Use the toolbox I meant exactly what I meant. Try it yourself. Your solution works too. To each her/his own, I suppose :-)
Use the toolbox
Did you mean
ip6fw delete $a? Otherwise it doesn't make much sense?In any case, try this:
ip6fw list $1 | cut -d' ' -f1 | xargs -rtn1 ip6fw deleteUse the toolbox
I meant exactly what I meant. Try it yourself. Your solution works too. To each her/his own, I suppose :-)