Reputation: 14970
I have six openvswitches that I have created using mininet.I want to dump the flow tables using a very simple bash script.For some reason this doesn't seem to be working.
for i in `sudo ovs-vsctl list-br` ; do {`sudo ovs-ofctl dump-flows $i`} ; done
gives the output
{NXST_FLOW: command not found
{NXST_FLOW: command not found
{NXST_FLOW: command not found
{NXST_FLOW: command not found
{NXST_FLOW: command not found
{NXST_FLOW: command not found
However if I do
for i in `sudo ovs-vsctl list-br` ; do echo $i ; done
I get the below output.
s1 s2 s3 s4 s5 s6
By the way I am able to do
sudo ovs-ofctl dump-flows s1
and get the right information.
What is wrong with my bash script.?
Upvotes: 1
Views: 270
Reputation: 6275
You're using command substitution and command grouping all at once.
You told bash to run the command (the backticks) and then treat the output as another command to run.
Upvotes: 0
Reputation: 3773
try:
for i in sudo ovs-vsctl list-br
; do sudo ovs-ofctl dump-flows $i; done
Upvotes: 0
Reputation: 179402
Why use the backticks? Just do
for i in `sudo ovs-vsctl list-br` ; do sudo ovs-ofctl dump-flows $i ; done
Upvotes: 4