All Questions
106
questions
0
votes
0
answers
17
views
Send SSH input when output string is detected on windows from python
My company requires a passcode when SSHing to a server:
ssh myserver
Enter a passcode or select one of the following options:
Passcode:
I want call SSH in the background from a GUI so want to detect ...
0
votes
0
answers
64
views
tar extract zip archive from file or STDIN - discrepancy
Training to download and extract archive (zip archive, created by 7z) by
curl --output - "https://host.com/archive.zip" | tar -f - -C %dest_dir%
but archive extract is incomplete. Some ...
0
votes
0
answers
68
views
stdin file descriptor never ready on POLLIN event
I have a C source code that I intend to port from Linux to Windows. After updating the 'poll' function to 'WSAPoll,' I notice that 'revents' on 'stdin' never becomes ready, causing 'WSAPoll' to block ...
0
votes
2
answers
105
views
Feed private key to pageant via STDIN
Is there a way in Windows to trick or simulate the file, made from other command output?
What I am looking for is the following bash equivalent, but for Windows and pageant:
sops --decrypt "${f}&...
-2
votes
1
answer
129
views
stdin is not plugged to piped data for /subsystem:windows linked applications
I try to make a GUI application that can tolerate piped data as input, if present.
The use case is either it gets started from file explorer, and it may have a command line argument or not.
Or, it is ...
4
votes
1
answer
425
views
Weird behavior in the console window in Windows 10
My console window have a code page of 437, and I have echoed Russian letters in the console window:
echo привет
And I got the correct Russian output, which is:
привет
But why am I getting the ...
1
vote
2
answers
77
views
redirected stdin ends prematurely Lua for Windows
I'm using Lua in a cmd window under Windows.
I use "cat" (from UnxUtils) to feed a file to a Lua script. The script uses "io.read(1)" to read one byte at a time.
local b, n ;
n = -...
0
votes
1
answer
154
views
Why does my program print a UTF-8 BOM on Windows?
I have the following program that works fine on Linux:
Cargo.toml
[package]
name = "ansi-color-codec"
authors = ["Richard Neumann <[email protected]>"]
description = &...
2
votes
1
answer
783
views
Rust and Python subprocess module with stdin.readline
Minimal reproducible example
I have created a minimal reproducible example that can be cloned and easily ran on Github for testing: https://github.com/VirxEC/python-no-run
If you don't want to go to ...
7
votes
3
answers
4k
views
Where are stdin, stdout files located in Windows?
Whenever I execute a C program, there are 3 standard files, stdin, stdout, stderr. Theses map to /proc/self/fd/0, /proc/self/fd/1, /proc/self/fd/2 in Linux, which link to /dev/pts/0 in my computer. ...
0
votes
2
answers
345
views
Python cannot read Stdin input on Windows and reacts like an infinite loop
I have a problem that only appears on Windows 10 when I run a python script from the console (or a ProcessBuilder in Java) with an stdin input.
When I run this code on Ubuntu :
import sys
print(sys....
0
votes
1
answer
546
views
How does one close stdin from the windows CMD prompt?
I know that one can close stdin when executing a command from a Linux CLI using logic such as:
0<&- <command>
This simulates/emulates running an application unattended, or within a CI/CD ...
0
votes
0
answers
48
views
How should my program push data for it's own scanf to read?
I'm in a coding competition where I upload my code to the competition host's platform to be compiled and run. The host then supplies my program with data to work on, through stdin. My code uses scanf(...
2
votes
1
answer
211
views
How to kill a Windows subprocess in Python when it expects a key but simply doesn't react to it through stdin?
I am trying to kill a subprocess that expects a key press 'q' in the terminal in order to stop gracefully.
This executable has two modes of running (tried both):
takes over the terminal with probably ...
0
votes
0
answers
25
views
Python3 If Else statement SyntaxError and IndentationError [duplicate]
I am new to Python and Stackoverflow. I tried looking at some of the already existing questions, but I could not see where I was messing up. Sorry in advance for the repeated question.
I am trying to ...