1

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.?

3 Answers 3

4

Why use the backticks? Just do

for i in `sudo ovs-vsctl list-br` ; do sudo ovs-ofctl dump-flows $i ; done
Sign up to request clarification or add additional context in comments.

Comments

0

try:

for i in sudo ovs-vsctl list-br; do sudo ovs-ofctl dump-flows $i; done

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.