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 and I can check with 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 $ ():

var = 'some command' >

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -