tty

Why does the sys_read system call end when it detects a new line?

我们两清 提交于 2021-02-20 05:56:48
问题 I'm a beginner in assembly (using nasm). I'm learning assembly through a college course. I'm trying to understand the behavior of the sys_read linux system call when it's invoked. Specifically, sys_read stops when it reads a new line or line feed . According to what I've been taught, this is true. This online tutorial article also affirms the fact/claim. When sys_read detects a linefeed, control returns to the program and the users input is located at the memory address you passed in ECX. I

Why does the sys_read system call end when it detects a new line?

徘徊边缘 提交于 2021-02-20 05:56:46
问题 I'm a beginner in assembly (using nasm). I'm learning assembly through a college course. I'm trying to understand the behavior of the sys_read linux system call when it's invoked. Specifically, sys_read stops when it reads a new line or line feed . According to what I've been taught, this is true. This online tutorial article also affirms the fact/claim. When sys_read detects a linefeed, control returns to the program and the users input is located at the memory address you passed in ECX. I

Why does the sys_read system call end when it detects a new line?

蹲街弑〆低调 提交于 2021-02-20 05:55:00
问题 I'm a beginner in assembly (using nasm). I'm learning assembly through a college course. I'm trying to understand the behavior of the sys_read linux system call when it's invoked. Specifically, sys_read stops when it reads a new line or line feed . According to what I've been taught, this is true. This online tutorial article also affirms the fact/claim. When sys_read detects a linefeed, control returns to the program and the users input is located at the memory address you passed in ECX. I

Spawning a child process with tty in node.js

删除回忆录丶 提交于 2021-02-16 04:45:25
问题 I am trying to do some work on a remote server using ssh--and ssh is called on the local machine from node.js A stripped down version of the script looks like this: var execSync = require("child_process").execSync; var command = 'ssh -qt user@remote.machine -- "sudo mv ./this.thing /to/here/;"'; execSync(command,callback); function callback(error,stdout,stderr) { if (error) { console.log(stderr); throw new Error(error,error.stack); } console.log(stdout); } I get the requiretty error sudo:

Spawning a child process with tty in node.js

一笑奈何 提交于 2021-02-16 04:44:07
问题 I am trying to do some work on a remote server using ssh--and ssh is called on the local machine from node.js A stripped down version of the script looks like this: var execSync = require("child_process").execSync; var command = 'ssh -qt user@remote.machine -- "sudo mv ./this.thing /to/here/;"'; execSync(command,callback); function callback(error,stdout,stderr) { if (error) { console.log(stderr); throw new Error(error,error.stack); } console.log(stdout); } I get the requiretty error sudo:

Golang get command tty output

青春壹個敷衍的年華 提交于 2021-02-08 05:23:23
问题 I'm using go's exec Run command to get command output, which works great when the command 'Stdout' field is set to os.Stdout , and the error is sent to os.Stderr . I want to display the output and the error output to the console, but I also want my program to see what the output was. I then made my own Writer type that did just that, wrote both to a buffer and printed to the terminal. Here's the problem—some applications change their output to something much less readable by humans when it

Golang get command tty output

社会主义新天地 提交于 2021-02-08 05:23:00
问题 I'm using go's exec Run command to get command output, which works great when the command 'Stdout' field is set to os.Stdout , and the error is sent to os.Stderr . I want to display the output and the error output to the console, but I also want my program to see what the output was. I then made my own Writer type that did just that, wrote both to a buffer and printed to the terminal. Here's the problem—some applications change their output to something much less readable by humans when it

How to get a unique ID for each Arduino

心已入冬 提交于 2021-01-29 04:50:35
问题 I use two Arduino Nano, and want to change their name as listed in /dev , because currently they are always ttyUSB<NUMBER> . How can I get a unique serial number to create a udev rule? I tried to get it via udevadm , but it returns the same serial ID for both Arduinos. /var/log: udevadm info -a -n /dev/ttyUSB0 | grep '{serial}' ATTRS{serial}=="0000:00:14.0" 回答1: Arduino Nano is based on ATmega328 which does not have a built-in USB controller. The USB connector on the board is connected to an

Temporary disabling child processes from parent terminal at runtime

徘徊边缘 提交于 2021-01-28 22:13:16
问题 Brief: there is huge Linux application with many child processes, and I need something like that: /* parent process, far from fork*/ suppress_child_output_to_parent_tty(); printf("important message"); /* huge piece of code */ printf("important message"); restore_child_output_to_parent_tty(); I know that exist a standard way to do this by make pipe, fork, redirect STDOUT to that pipe, select&read pipe /write to parent stdout at the some loop at different thread, manually pause this loop when

How do I make a background process block for input a la the shell's `bg` command?

烂漫一生 提交于 2021-01-28 08:15:23
问题 I am implementing my own fragment of code for a security control purpose. It normally runs in the background but on a timeout needs to take over the current terminal, display a message, collect user input, and react to the user input. Waiting for the timeout is easy. Collecting user input while sleep is the active program is easy. Preventing the shell from stealing the user input I just tried to collect is not so easy. I am reasonably convinced that "What if two programs did this?" doesn't