Questions tagged [stdin]
Standard input (stdin, file descriptor 0) is the input stream to a program.
stdin
3,919
questions
0
votes
0
answers
44
views
How to get rid of Go routine "process" after the GO routine times out?
I have an interesting challenge.
I have a go routine that should display an error message for 4 seconds or until I press any key.
If I press a key within the 4 seconds it works as expected but if I ...
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/...
0
votes
2
answers
105
views
How can I read from stdin in a test with Maven?
I'd like to read from stdin as part of a test for my Java project, which uses Maven as its build tool.
My Java code is something like this (simplified for demonstration purposes):
try (Scanner stdin = ...
0
votes
2
answers
76
views
Make sh Commands Stream to Capture Stdin
Having script.sh
#!/bin/sh
sh <<EOF
cat | xargs -n 1 echo captured
echo first
echo second
EOF
Running this would output
captured echo
captured first
captured echo
captured second
So that the ...
1
vote
1
answer
162
views
how can i send the backspace key to stdin?
I'm creating a Node.js application in Linux that spawns a child process, bash, when someone connects to the server via WebSocket. It sends all data sent through the WebSocket to stdin and sends all ...
4
votes
2
answers
583
views
Bash - Check if the standard input contains anything
I know this question has been asked several times but it seems ineffective in my case.
[[ ! -t 0 ]] = Does standard input contains anything?
This command:
echo 'Hello world' | [[ ! -t 0 ]]
echo $?
...
0
votes
2
answers
59
views
Who should be responsible for "program startup with three std streams opened"?
I'm working on my study purpose OS kernel, now I have a confusion about creating time of standard streams.
The famous "APUE" said that "By convention, UNIX System shells associate file ...
0
votes
1
answer
178
views
How can I compile a program using Clang from standard input?
I have a program coming from standard input. I would like to compile it. Is this possible and if so, how can I do this?
0
votes
0
answers
87
views
Object 'Kind' is missing error while running skaffold dev command
after running skaffold dev command this error i am getting, i am using docker desktop in windos and running this command in linux enviorment wsl subsystem docker and kubernents are working fine i ...
1
vote
1
answer
133
views
How can I make a child process's stdin inherited and piped?
I want to create a child process that will take normal input from the parent stdin. but at the same time i want to send signals through its stdin (ctrl+c - 0x03 like xterm does).
Using the standard ...
1
vote
1
answer
114
views
How do I capture stdout and simulate stdin in a Haskell Tasty test?
My impure functions are defined as follows:
module HangmanImpure (HangmanImpure.getLine, HangmanImpure.putStr, HangmanImpure.putStrLn, HangmanImpure.strlen) where
import qualified System.IO as Sys
...
0
votes
2
answers
73
views
stdin is not being saved to file
I am trying to get a better understanding how stdin works and how to specifically work with it in Python.
I am trying to save whatever is received from stdin to a file. The file should have two lines
...
0
votes
0
answers
59
views
My simple python program does not execute the last line
I have a simple Firefox extension, I have pretty much figured out the Firefox side of things (JavaScript, DOM and starting the Python program).
To explain how everything is supposed to work:
A event ...
0
votes
0
answers
62
views
Write into stdin, read from stdout Subprocess/Process in Glib/GTK Vala
I have a test bash/sh script. It simply shows a question and reads answer from console, then it shows output:
#!/bin/bash
# Ask the user for their name
echo Hello, who am I talking to?
read varname
...
-1
votes
1
answer
36
views
Standard input in dale programming language
How can I get in dale the standard input to get data from any file? Thanks in advance.
I've already tried with the "gets" built-in functions. May be I've been doing something wrong.
I need ...