Could you please advise , I'm trying to run a "for" loop on a shell command line
for i in `seq 4`; do `wireshark &`; done
From some reason the loop isn't finish and only 1 wireshark window is open
You really don't want to put wireshark & in backticks. The shell that executes your loop creates a subshell to run wireshark and is waiting for that subshell to close all of its open file descriptors that are writing to stdout so that it can collect the data written. (That's what the bacticks do!). If you just want to run wireshark in the background, then this should work:
for ...; do wireshark & done
Note that backticks is pretty ancient syntax, and $() has been preferred since the mid 90s at least. If you're going to use seq you should write it as for i in $(seq 4); do .... You're using bash, so you could do for((i=0; i <4; i++)). There are a lot of ways to do the iteration, but that's not relevant to the issue you're having.
You don't need to use seq external command in bash and `wireshark &` is not correct - backticks are used for command substitution but
notice that $() is recommended over backticks these
days. It should be:
for i in {1..4}; do wireshark & done
for ((i=0; i<4; i++)); do wireshark &; done. That most likely won't fix your problem thoughwireshark &in backticks?