Questions tagged [stdin]

stdin is the name of the default input file descriptor of a process. Since there is really nothing special about stdin, you should not use this tag. Use the [io-redirection] tag for questions on how to redirect input, use [file-descriptors] for questions on how to manage file descriptors, use [lock] for questions of file locking, and use [files] for general questions on file operations.

stdin is the name of the default input file descriptor of a process. Since there is really nothing special about stdin, you should not use this tag. Use the tag for questions on how to redirect input, use for questions on how to manage file descriptors, use for questions of file locking, and use for general questions on file operations.

320 questions
3
votes
0 answers

Terminal prompts immediately abort

When issuing commands that require a prompt midway (eg apt install), the prompt immediately aborts, as such: self@localhost:~$ sudo apt install xterm Reading package lists... Done Building dependency tree Reading state information...…
1
vote
1 answer

How do I read n bytes from file descriptor 0 to a file? Bytes can be any value

I need to read a specific number of bytes from fd0 and write them to a file. The bytes can have any value. I assume I can't use dd since it stops at the EOF byte. Using if=/dev/stdin won't work since my fd0 isn't the keyboard.
hehehe
  • 13
1
vote
1 answer

automatically script up responses to a program that already reads from standard in

I'm trying to script up a call to scrypt, a command line encryption program. I can call it like this cat ./mysuperescrettextfile.txt | scrypt enc - and the dash makes it read from standard in to get the data to encrypt. But then it prompts twice…
0
votes
0 answers

How does a tool like grep recognize end-of-input when reading from stdin

How does a tool like grep know when the end of file is reached, when reading from stdin (like in foo | grep)? The EOF byte could belong to the original file, so it can't rely on that. Does it rely on the fact that the pipe is closed or something…
hehehe
  • 13