I have the following command which I trying to execute in a custom bash script in Linux:
CMD="gnome-terminal"
CMD="$CMD --tab -e \"ssh root@172.16.17.4 'iperf -c 10.0.0.7 -t 10 -i 0.1 -f m | awk '{print $7}' > results.txt;tail -n1 results.txt'\""
eval ${CMD}
It seems that bash is getting confused during the execution because of the single quotations after the grep command for matching a regular expression. So my question who can I inform the bash that those single quotations are part of the command to be executed?