[SOLVED] Is there a better way of extracting certain data from xwininfo output?
by dave999 from LinuxQuestions.org on (#6D4YT)
hi,
Is there a simpler way of extractng some data from command output? Below is a partial output of xwininfo.
Absolute upper-left X: 430
Absolute upper-left Y: 136
I want to get the digits and format it like so:
430,136
I've used this command and it does the job. But it quite long.
Code:xwininfo | grep "upper-left" | head -n 2 | egrep -o "[0-9]+" | tr "\n" " " | awk '{ print $1 "," $2}'
430,136
Is there a better,shorter way of doing this?
Thx
Is there a simpler way of extractng some data from command output? Below is a partial output of xwininfo.
Absolute upper-left X: 430
Absolute upper-left Y: 136
I want to get the digits and format it like so:
430,136
I've used this command and it does the job. But it quite long.
Code:xwininfo | grep "upper-left" | head -n 2 | egrep -o "[0-9]+" | tr "\n" " " | awk '{ print $1 "," $2}'
430,136
Is there a better,shorter way of doing this?
Thx