I have the following command for monitoring network interface link status :
Code:
watch 'for i in `ifconfig | cut -f 1 -d " " | grep -v lo` ; do echo $i ;sudo ethtool $i | grep Link ; done'
It works fine giving me the following output:
Code:
Every 0.5s: for i in `ifconfig | cut -f 1 -d " " | ... Mon Aug 17 11:14:53 2009
eth0
Link detected: yes
eth1
Link detected: yes
Now I want to open a new terminal window with this command so I need to do something like this:
Code:
gnome-terminal -e watch 'for i in `ifconfig | cut -f 1 -d " " | grep -v lo` ; do echo $i ;sudo ethtool $i | grep Link ; done'
Here I go into troubles because the argument string for the -e switch must be quoted and putting the whole string inside single or double quotes does not work because I already have quotes inside the string. Please, help.