I think there is a number of problems with your code. First you should've quote the arguments yourself unless you want to reach the application quoted (and you probably don't). Second, you might want to split the filter argument into separate tokens unless wireshark expects to receive the filter as a single argument (you would have to quote it out escape the spaces when starting the command from cli). Third, redirection operator is interpreted by the shell and there is no shell here thus '>' will be passed to the application you are running and it probably won't understand it. You will have to intercept the output yourself and stream it to the destination file.
Bookmarks