I am working on a bash script that use de `ip rule...` command to add and remove some rules. But I am having problems removing them. For example `ip rule show` output looks like this:

```
0:  from all lookup local 
32764:  from all fwmark 0x3022 lookup 12322 
32765:  from 10.10.10.1 lookup 12322 
32766:  from all lookup main 
32767:  from all lookup default

```

All the info I have is the table id (12322) and I need to remove all the rules that lookup that table.

I tried these commands: `ip rule del table 12322` and `ip rule del lookup 12322`, but both commands remove always the first rule, and not the first rule that lookup 12322, I mean the first rule `from all lookup local`. If I run any of those commands 5 times I end up with no rules.

How can I remove all the rules that `lookup 12322` in one command?