Questions tagged [stdout]
Stdout is the standard output stream is the default destination of regular output for applications.
122
questions
17
votes
2
answers
4k
views
How does ls know how to output its results?
While creating a bash script, I found that this code ls puts all files on one line:
pi@raspberrypi:~/ptlrestinterface$ ls
update.sh web.config MyApp.runtimeconfig.json
still ls | head -n1 ...
3
votes
2
answers
1k
views
PowerShell redirection of Write-Host to file is not working
Can someone explain me that behaviour? What is wrong?
PS C:\Scripts\Customer_Shares_Permissions> $PSVersionTable
Name Value
---- -----
...
0
votes
1
answer
679
views
Disable stdout buffering in systemd, how to make it print everything?
On Debian, when I ask for service status, it only prints out a few lines:
sudo service tor status
CPU: 3ms
Dec 15 17:57:27 systemd[1]: Starting tor.service - Anonymizing overlay network for ...
2
votes
1
answer
3k
views
zsh: stdout and stderr both to console AND log
I'm converting a script from bash to zsh and have been floundering for days with the output. I want the stdout and stderr to both go to both the console and a log file. I've tried everything I can ...
0
votes
2
answers
274
views
How can I run an exe from stdout?
I have a .exe file hosted as a release on a Github project, it is my project so I know this file is secure as I have compiled it. https://github.com/USERNAME/PROJECT/releases/latest/download/TORUN.exe ...
1
vote
1
answer
1k
views
Batch: How to show only errors in console output (ie redirect STDOUT to NUL and STDERR to CON)?
I'm trying to figure out how to show only errors on the console output (and suppress all other output) without redirecting to a file or using TEE, etc. I'm trying to get this to work for single ...
1
vote
2
answers
2k
views
batch script - How to conditionally redirect output stream(s)
In summary, the goal is twofold:
Create a logfile that only contains commands that have failed, plus the error messages those commands generate.
Prevent console output (success or failure), except ...
1
vote
1
answer
37
views
How much data can be reliably passed between processes? [closed]
I have a server written in nodejs which is calling a Rust binary using the spawn functionality and I need to pass a few megabytes worth of data between the binary and the nodejs server. Would it be ...
0
votes
1
answer
557
views
redirect nmap to stdout instead of writing it into file
I'm creating python program running nmap -sn on a remote server.
Is there a way to redirect nmap -oX directly into stdout or a different channel instead of writing it into a file?
2
votes
1
answer
15k
views
How to invoke a command in PowerShell and get the output without having to wait for completion?
I use the following code to run a command and get the output :
$result = Invoke-Command { .\SomeExecutable.exe }
Write-Output $result
It works but major issue is that I have to wait for completion (...
1
vote
1
answer
110
views
Build tool spawns a daemon that does not close its standard output. How can I prevent this from stalling my shell pipeline?
I am using a (closed-source) vendor-specific build tool (Microsemi Designer, an
FPGA layout tool). I invoke it from a shell script (highly simplified):
... # Setup
/opt/.../designer SCRIPT:my_script....
0
votes
0
answers
1k
views
Generate GPG key without saving to keychain
I am trying to generate a GPG key with gnupg. However, instead of exporting the secret key to a file, I am trying to pipe it to another program (keybase pgp import) that will process it.
Right now, I ...
0
votes
0
answers
60
views
How does the Docker build command limit row count for the image's stdout? (see my gif pls)
docker build process
I read that docker build is using some templates written in Go but I'm trying to achieve this for a yarn add or start from a python script. Their outputs are too verbose and I don'...
1
vote
1
answer
1k
views
Get file via SFTP to stdout [duplicate]
I'd like to get a remote file with SFTP, but choosing stdout as the local destination. I tried the obvious code below, but it failed:
echo 'get <Remote file> /dev/stdout' | sftp <User>@<...
8
votes
0
answers
12k
views
Docker: "failed to get console mode for stdout: The handle is invalid."
When running docker-compose up in Windows PowerShell using Docker Desktop on WSL2, I get
Creating network "test_default" with the default driver
Building master
failed to get console mode ...
0
votes
1
answer
555
views
Script runs slow processing stdout piped from service
I am using a utility named oscdump which listens on a specified port for OSC messages and prints the messages to stdout. I wish to parse and process these messages in a script however my script runs ...
0
votes
1
answer
4k
views
Supress stdout except for echo commands but show stderr
I have put a very large bash script together that installs packages and configures a LAMP stack etc. With any scripting I usually do, I like to tidy it up by using echo commands to let the user ...
1
vote
0
answers
20
views
What is the point of such handle redirection as 1<&2? [duplicate]
According to what is said here:
For example, the following command redirects handle 2 (that is,
STDERR) into handle 1 (that is, STDOUT):
1<&2
I understand why we might need to apply the ...
0
votes
1
answer
266
views
ffmpeg issue when converting audio to png to stdout, but is ok to file
when I try to convert an audio to an image (amplitude spectrum) sending its data to stdout (it's embedded in a script so I do not need to write on disk) it fails
ffmpeg -y -f alaw -ar 8000 -i ...
1
vote
1
answer
288
views
Moreutils' Chronic reports everything in STDOUT, but only when run in cron
I prepared the following script to test chronic & cron:
echo "normal out"
echo "error out" >&2
exit 0
When I run it on normal shell with chronic -ev, output is as ...
0
votes
1
answer
114
views
Reroute pid output
Heyo all,
Say I have a bash file.
echo "Hey!"
echo "Hay!"
bash ~/otherstuff.sh &
It's the last line that annoys me. I'd like it to be done in the background, which it ...
1
vote
0
answers
209
views
How to launch a subprocess with captured output, but letting the subprocess believe it isn't captured?
Imagine launching a subprocess say my_binary in these two ways (I'm using bash for simplicity, but I assume this applies for other languages on POSIX systems):
#!/bin/bash
# 1) inherit stdout/stderr
...
1
vote
0
answers
747
views
firefox --help Nothing to see on Stdout
When running firefox --help or firefox -h there's nothing to see in the command window.
When running firefox --help | more, the help text is visible:
Usage: firefox [ options ... ] [URL]
where ...
0
votes
1
answer
763
views
Parse lines written to standard out in "real time"
First, I having only been learning Powershell for about a week primarily adapting Linux scripts to run on my (more powerful) Windows machine. So, please be kind with the lingo.
I am trying to write a ...
2
votes
1
answer
334
views
How to pipe stdout into stdin of optipng?
Is there any way to do something like this: (or why below code doesn't work?)
type input.png | optipng -out output.png
p.s: type is Windows version of cat Unix command
0
votes
0
answers
50
views
Run a windows command line utility allowing it to display its output to screen AND loggin it to file.txt
i have a utility i want to run which does not allow logging in the options/arguments of the program itself.
I can naturally run the program with a > logfile.txt
However, i would like to see the status ...
3
votes
2
answers
2k
views
Configure .bashrc to save all commands and output
For a new project we are setting up a Linux box that will run several processes. To be better able to backtrack or rollback configurations we'd like to keep a persistent history of all commands ...
0
votes
1
answer
319
views
how to send the decompressed output of archives to standard output?
When you decompress a gzip archive with gunzip without any arguments, the archive disappears, and you're left with the decompressed file in its place.
However, if you use the -c option, the archive ...
26
votes
5
answers
8k
views
Watching something be written to a file live with tail
I have a python program which is, slowly, generating some output.
I want to capture that in a file, but I also thought I could watch it live with tail.
So in one terminal I'm doing :
python myprog....
1
vote
0
answers
2k
views
grep output is not in stdout or stderr
I'm trying to find files that contain 'ash' and 'bun' with the following bash command:
grep --line-buffered -ril ash | xargs -d '\n' grep -il bun
Output from the first grep only (the names of files ...
1
vote
0
answers
98
views
How non entry point (random) process running inside Windows Container could write to docker default log output (stdout)?
So, I have one Windows Container with various processes, .NET and Win32 legacy applications.
First scenario
Entry Point calls myConfigurator.exe, who calls first.exe, who creates a pool of second....
0
votes
0
answers
3k
views
Extract tar file directly to stdout or other command like partition image extractor
Let's say I have TAR file with some partition images (dd/patclone/partimage/fsarchiver/whatever) and text file with MD5 sums (of image file and original partitions). I don't want to extract the image ...
0
votes
0
answers
180
views
Bash Output-Prompt
So i'm customizing my PS1-Bash-Prompt at the moment and found the iPython way of displaying in- and output pretty neat.
As you can see, i have my PS1-Prompt configured to look (almost) like the ...
7
votes
2
answers
8k
views
How can I redirect output from stdout into vim? [duplicate]
I would like to view the output of echo in vim, and save to a file after having a look at it. I have tried echo $PATH | vim, but I get the following error:
Vim: Warning: Input is not from a terminal
...
2
votes
2
answers
4k
views
How to pipe output of command to another command while also displaying it on the console?
I want to write part of the results of a stream to a file, but I want the entire contents of the stream printed to the console. Is there some command that would help with this?
Minimal example:
Say I ...
1
vote
1
answer
367
views
Is there a Windows program for loading child process images with redirected stdout/stderr?
I have a program that has stdout and stderr available, so it can and does write important output on these channels. You only see this output when you e.g. launch it from a Windows console window, ...
0
votes
2
answers
1k
views
Unexpected result while using pipe operator inside a shell variable
I have a process that dumps some zipped output to the stdout. What I do with this output is pipe and send it through an SSH tunnel to another machine where it is dumped to a file.
Like so:
/usr/bin/...
0
votes
1
answer
1k
views
How to redirect stdout and stderr in bash script with dialog boxes?
For a single script redirecting stdout and stderr to a file with this:
./myscript.sh 2>&1 | tee -a out_file
works fine. When I try to run the same way a script containing multiple dialog ...
0
votes
1
answer
1k
views
PowerShell: **reading** input from the keyboard AND **redirecting output** to a variable/file
Sorry if my question is trivial; I'm a beginner with PowerShell.
My program (plink) is expecting for an answer from the keyboard and will return some output.
Is it possible to redirect the output to ...
1
vote
1
answer
166
views
Piping StdOut adds more text
I am running a simple command (some Kafka related stuff):
curl localhost:8083
Its output is very simple:
root@debian:/etc/kafka# curl localhost:8083/
{"version":"0.11.0.0-cp1","commit":"...
0
votes
0
answers
265
views
How to make a background process foreground in Linux
I started a program in Linux with the command screen -d -m sbt run. How to make it again to foreground or at least view it's logs and prints? My application is a dev mode play framework web ...
0
votes
1
answer
437
views
How to list processes using my current terminal for their stdout/stderr
Sometimes I have processes which are not descendents of the shell I am using, but they still have my console open as their stdout or stderr (eg running setsid yes & will get me in this state). How ...
1
vote
1
answer
123
views
PID of TTY/stdout users
Is there a way in Linux to see the statistics for userspace apps that end up printing data to TTYs or to stdout (the actual stdout, not apps with stdout redirected to files on storage devices)?
...
5
votes
2
answers
4k
views
How to truncate file used to redirect stdout
I am trying to truncate a file, used for redirected stdout. For example:
ping localhost>/tmp/test.log
If I call rm /tmp/test.log then redirection stops but the command works.
If I call truncate -...
0
votes
1
answer
1k
views
Disable stdout in Windows commands
Is there a way to disabled the stdout in a windows command specifically the net start/stop spooler command?
5
votes
2
answers
21k
views
What does > /dev/null 2>&1 || true mean in Linux?
"command "> /dev/null 2>&1 || true
Now I get that we are sending the output of a command we run, to a null file. I need to know specific meaning for *2>&1 || true*
1
vote
1
answer
458
views
Multiple stdout to one stdin
I'm on Windows, although I could be on Linux so solutions for either are welcome.
I have a program that is essentially a game with 4 players that take an instruction from each of those players. ...
8
votes
2
answers
491
views
Peek at `at` output before it completes
Let's say I run a script with at on Linux (example below) that I know is going to take several hours, or maybe even multiple days. I'm accustomed to at sending an email with the output of the command ...
1
vote
1
answer
10k
views
How do I redirect output from python to file
I want to redirect all output (stdout and stderr) of console to the text file. I make the following steps:
Open cmd.exe
Start command:
"python.exe" > "file.txt"
After that, I'm waiting for the ...
13
votes
3
answers
4k
views
Two Programs having their StdIn and StdOut tied
Suppose I have two programs called ProgramA and ProgramB. I want to run them both simultaneously in the Windows cmd interpreter. But I want the StdOut of ProgramA hooked to the StdIn of ProgramB and ...