Questions tagged [stdout]

Stdout is the standard output stream is the default destination of regular output for applications.

Filter by
Sorted by
Tagged with
1
vote
1answer
50 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>@<...
6
votes
0answers
7k 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
1answer
146 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
1answer
52 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
0answers
17 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
1answer
15 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 ...
0
votes
1answer
38 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
0answers
12 views

How to print stderr to terminal only in Linux?

In Linux writing "hello" will print "Hello, world!". 'hello > file.txt' will redirect that string into a file named file.txt. 'hello 2> file.txt' will redirect any stderr ...
0
votes
1answer
20 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
0answers
20 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
0answers
138 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
1answer
83 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 ...
0
votes
0answers
26 views

why does echo “something” >> file disappears? (written by another process) [duplicate]

I'm redirecting the stdout and stderr of a 3rd party process to a log file. I want to add markers to that log file, they disappear when I get the final file. 3rdParty-process &> log & <&...
1
vote
1answer
100 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
0answers
22 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
2answers
437 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
1answer
49 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
5answers
5k 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....
0
votes
0answers
393 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
0answers
75 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
0answers
864 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
0answers
96 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 ...
5
votes
2answers
3k 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 ...
1
vote
2answers
796 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
1answer
113 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
2answers
135 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
1answer
640 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
1answer
809 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
1answer
69 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
0answers
180 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
1answer
208 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
1answer
95 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)? ...
4
votes
2answers
2k 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
1answer
319 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
2answers
14k 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
1answer
270 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
2answers
372 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
1answer
4k 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 ...
12
votes
3answers
2k 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 ...
1
vote
2answers
120 views

How to terminate a cli app when stdout contains a certain string?

I've got a command line app that outputs lots of information to stdout. How can I terminate the program when stdout contains a certain string? e.g. something like: my_program | ...
2
votes
0answers
433 views

See contents of conhost

Every now and then, various programs create conhost.exe processes on my (Windows 7 x64) computer. I know they are console windows, except the windows themselves are hidden. I don't suspect any ...
0
votes
1answer
440 views

how to see the output of a cron/at jobs while it is still running?

The output of a cron or atq job is automatically send by email to the user, when the job is finished. However I am running a time consuming script, and I would like to check that it is running ...
3
votes
2answers
1k views

PowerShell v5: Suppress Out-Default output in nested functions

I'd like to suppress any output then function_b is invoked: Function function_a { "test" | Out-Default } function function_b { [CmdletBInding()] param() function_a } # These are ...
1
vote
0answers
44 views

Parsing (or Converting) Buffered Output

If a dynamic, text-based, CLI application doesn't include an option for producing unbuffered text output; what options do I have for parsing said output? Can it be converted to a more appropriate ...
1
vote
1answer
2k views

Redirect STDERR and STDOUT to file with timestamp on each line

On my CentOS I am trying to execute a php script that contains an endless loop to do some fancy stuff inside. It doesn't matter that an endless loop may not be an accurate solution for most cases, but ...
0
votes
1answer
74 views

How to stop background processes from outputting permanently?

In my newly installed Lubuntu virtual machine terminal, when I run firefox & firefox runs in the background, but it keeps on outputting in my terminal. I found a way to stop it from another ...
7
votes
1answer
9k views

How to echo only 1st line from 'curl' command output?

I'm trying to get only first line of the curl command output. (Sorry if this is confusing) Let's say, for an instance, i run simply: # curl http://localhost <!-- This is the hidden line i want to ...
1
vote
2answers
98 views

How to unset a “>” echo in Linux

I've just realized I don't know how to unset an echo I set with >. The exact current situation is I just set dmesg > /var/log/syslog and now wanted to unset it, realizing I've never done that ...
2
votes
1answer
1k views

reading stdout in pipeline using “-” fails for “docker exec”

I want to launch a bash terminal for my Docker instance by piping the first container ID to docker exec: docker ps | head -2 | grep -v CONTAINER | cut -d' ' -f1 | docker exec -i -t - bash The final -...
1
vote
1answer
130 views

Unexpected BPython console output behaviour

I am using BPython to run Python scripts, and I found the console output has a different behavior than the regular Python console.. For example this small snippet: import time for i in range(100): ...