Skip to main content

All Questions

Tagged with
0 votes
0 answers
36 views

asio::stream_descriptor for async read from stdin in raw mode crashes

I want to poll stdin asynchronously for terminal keyboard events, hence the following /* class tui contains a member 'stdin_' of type 'asio::stream_descriptor', initialized as such : stdin_{...
kmft3kte's user avatar
1 vote
1 answer
62 views

Piping input into running Python script

Maybe this is the wrong approach, so feel free to redirect. I am trying to asynchronously pipe input into a python script. The idea is that I have a background Python script do some long initial setup ...
BrettOC's user avatar
  • 69
3 votes
1 answer
202 views

Reading and Writing more than 4096 bytes to and from STDIN [closed]

I'm trying to implement a here document like the one used in bash (in C), but I noticed that I can't give it a line that's longer than 4096 bytes, I looked it up and It was because of the max size of ...
Anass Abidar's user avatar
0 votes
0 answers
85 views

How to execute process with mmap-ed memory as stdin and another mmap-ed memory as stdout?

It is possible in Linux execute process with mmap-ed memory as stdin and another mmap-ed memory as stdout, so parent program can preallocate memory for stdin, write necessary data, execute program and ...
Антон Сазонов's user avatar
1 vote
2 answers
37 views

How to apply the linux 'file' command to the output (STDOUT) of a program to determine its file type

I want to determine the file-type of the contents of the STDOUT output of a program (without first saving the output to a file) i.e., notionally, I would like to run: myprogram | file However, `/usr/...
puterboy's user avatar
0 votes
1 answer
188 views

x86_64 nasm read syscall isn't null-terminated

x86_64 nasm read syscall isn't null-terminated New to assembly. In fact this is my first hello world program. OS: Arch Linux (64-bit) Logic I have three functions. strlen, stdin and stdout. strlen: ...
Logan Seeley's user avatar
0 votes
1 answer
55 views

Why isn't my output maintaining integrity after a pipe to a program that takes input from stdin?

My output gets corrupted when I try to pipe some output to another command in the shell. This doesn't happen when I execute the executable alone, or redirect its output to a program that doesn't care. ...
Patrick O'Brien's user avatar
0 votes
1 answer
33 views

Is there a way to get the command ran to get stdin output in python?

So I've found a way to read from stdin in python, which is as follows: if not sys.stdin.isatty(): stdin = sys.stdin.read() but for a statement like this, echo Hello | program.py I only get stdin ...
Nauto the Boss's user avatar
0 votes
0 answers
88 views

(C++) How to have stdout update in real time without affecting stdin

I'm trying to make a simple chat program in the Linux terminal. For simplicity, the "users" are just multiple instances of the terminal on a single machine. However, I don't know how to ...
Patrick O'Brien's user avatar
0 votes
0 answers
91 views

When I change stdin to raw mode, stdout is affected... why?

I have a Linux program that I need to change stdin to raw mode. I use this code: if (isatty(STDIN_FILENO)) { if (tcgetattr(STDIN_FILENO,&tiostdin) != 0) { perror("...
Ed.'s user avatar
  • 936
1 vote
3 answers
458 views

Why do shell scripts not behave the same when called from node.js?

My problem I have a simple sh script that behaves exactly as I want, unless it's called from a node.js script. What the sh script is supposed to do Convert the (potentially binary) data passed via ...
Forivin's user avatar
  • 15.2k
-1 votes
3 answers
1k views

How to pass password using -S (stdin) in terminal?

i am trying to pass the password using stdin but I am getting an error. Here is what I tried. echo myPassword | sudo -S su - userName -s /bin/bash echo 'myPassword' | sudo -S su - userName -s /bin/...
KbiR's user avatar
  • 4,104
0 votes
1 answer
272 views

How to write a char to the stdin in C?

I'm making a minishell and I have to create in C a command as "<<" in bash. So I have to enter some input in the terminal and redirect it to the standard input but I'm having problems ...
Dani Cruz's user avatar
1 vote
1 answer
147 views

Redirection Operators: two cases

Consider the following command line: cat <<< "Hello World" > output1.txt > output2.txt ... > outputn.txt In this case we have <<< here-string operator, which is ...
gaband's user avatar
  • 27
2 votes
1 answer
279 views

Go Lang: Can't change children's stdin

I want to completelly drop STDIN in parent and children processes. CONTEXT: I am spawning children process from main Go process. It is spawned in Go routine. Somehow FDs (stdin in this case) are ...
Dušan Panić's user avatar

15 30 50 per page
1
2 3 4 5
16