Wednesday, May 8, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 3733  / 1 Year ago, sun, january 22, 2023, 6:13:06

While gnome terminal shows output of below command, it doesn't pipe it out to text file



 xinput test 5 


shows output in terminal but



 xinput test 5 >> text.txt 


doesn't pipe out to file



EDIT:



"xinput test 5" shows key codes of virtual keyboard.
I can see output in terminal with " xinput test 5" but not with "xinput test 5 >>text.txt



It shows keycodes from onboard.



EDIT2:



I want to record keystrokes of "onboard" to file
"xinput test 5" shows the keystroke IDs well in terminal but it doesn't save it to file with " xinput test 5 >> text.txt " it also prevents showing keystroke IDs in terminal.
"xinput test 5 2>>text.txt" shows output in terminal but doesn't pipe it out to text file.



EDIT3:



You can find virtual keyboard ID with "xinput list"
Interestingly can see output in terminal with " xinput test 5" but not with "xinput test 5 >>text.txt


More From » command-line

 Answers
7

The output is buffered, so nothing goes to the file until the writer (xinput) flushes it.

To force unbuffered output you can use



stdbuf -o0 xinput test 5 >out

[#27855] Tuesday, January 24, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ibuteking

Total Points: 35
Total Questions: 128
Total Answers: 138

Location: Indonesia
Member since Thu, Oct 1, 2020
4 Years ago
;