Using xrandr | grep '*'
I would like to find the x resolution of all monitors on our network. This is to assist in the automatic placement of xterms in other scripts.
Some of our systems are running redhat 6.4 and others redhat 5.8 and the results of xrandr differs depending on redhat version
For redhat 6.4 xrandr | grep '*'
returns
1680x1050 60.0*+
and for redhat 5.8
*0 1680 x 1050 ( 474mm x 303mm ) *50
I have tried xrandr | grep '*' | sed 's/\s+\(\d\{4\}\)\s*x\s*\d+/\1/'
but this returns the same string as highlighted above for 5.8 and 6.4. The desired output is 1680 in both cases
Any hints?