linux - shell, match a string in terminal output -
I will go see if my touch screen is calibrated with a script. But I really have some experience with the shell scripts. I hope someone can help me.
My idea is that xinput --list-pros & lt; Device & gt; Execute and check the terminal output with the entry . (242): & lt; No items & gt; This option is if the touch screen is not otherwise calibrated, then x / y coordinates like ... (242): 1 22 333 4444 .
In my script I get the xinput --list-pros grep (242) and then if an entry & lt; No items & gt; Check the same line at but I have failed to read the output from xinput --list .
reads the terminal output from #in xinput $ xinput_output = less xinput --list-pros 7 Check out the line before $ Xinput_output # 7 "$ 242" $ xinput_output If $ [$? ! = 0] break; Other # 242 check x / y coordinate grep "" $ Xinput_ouput if $ [$? ! = 0] Then exit the #NoX / Y coordinate, Xinput_kelibreson xinput_calibration 0f fi & lt; $ 1
Attach your order with backcat or $ ():
Comments
Post a Comment