Questions tagged [stdout]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

error info : input file is output file

Redirect all stdout into a file. exec 1> /tmp/stdout All info shown on stdout (screen) previously will write into /tmp/stdout. pwd #No info shown on screen I want to read info on /tmp/stdout. ...
0
votes
1answer
81 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
28 views

Why not the stdout/stderr of my script as a systemd.service be redirected to journald?

I saw that systemd redirects all of stdout/stderr of a unit to journald by default, but I forget where I saw it. The output of my binary programs such as those compiled by gcc, has been redirected ...
0
votes
0answers
20 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 & <&...
0
votes
1answer
27 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
20 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
248 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
30 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 ...
25
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
261 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
64 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
550 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
78 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 ...
4
votes
2answers
2k 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
282 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 ...
1
vote
1answer
83 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
91 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
503 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
694 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
67 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
165 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
201 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
89 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
228 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
12k 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
201 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
357 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
3k 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
103 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
365 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
313 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
771 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
42 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
1k 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
72 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 ...
5
votes
1answer
7k 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
90 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
128 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): ...
2
votes
4answers
276 views

python2.7 from macports stdin issue

My python2.7 from macports seems to mess up with osx terminal in a weird way. Here is what I mean. The exact input from the keyboard was: /opt/local/bin/python2.7<ENTER> a = 3<ENTER> a&...
9
votes
1answer
16k views

How to get stdout of a “lost” session

I don't well what's the name of the situation, I think yesterday I closed a session with a background ipython process, but I am still able to connect to it (the process is running a web server and I ...
0
votes
1answer
168 views

Weird result of initiating a variable with the output of 'git describe'

For some reason this assignment: OUT=$(git describe HEAD) prints to the stdout (for example): fatal: No names found, cannot describe anything. Is this a normal behavior? Why doesn't this happen with ...
0
votes
1answer
150 views

Modify terminal STDOUT/STDERR to change the line colour based on a REGEX

Is this possible? What I would like to achieve is when running unit tests (Python) to highlight any line which matches the path to the current project directory and leave other output untouched. ...
2
votes
2answers
2k views

Redirect stderr to second terminal / tty

I've tried things like rse to differentiate standard-output and standard-error streams from a program; but I'd really like the option of viewing the two in separate terminals, without redirecting to a ...
2
votes
1answer
3k views

Using PuTTY SSH, how do I capture the remote output of a command?

In Linux ssh me@server "echo this ran remotely" The output this ran remotely is put to standard out. This is perfect. In Windows echo "echo this ran remotely" > test.cmd putty -i privatekey.ppk ...
3
votes
1answer
3k views

shell standard streams redirection order OR 2>&1 1>/dev/null vs 1>/dev/null 2>&1

Can somebody please clarify differences? Is some of those considered as best practice? If I remember correct I somehow on SO read that this 1>/dev/null should precede this: 2>&1 ls -al /...
0
votes
1answer
67 views

Which is the preferred approach to pass command/script arguments to a log file?

Generally, I am wondering how I can pass the arguments from a terminal command to stdout. More specifically, I am using tar as part of my backup process and I would like the parameters (especially ...
1
vote
1answer
3k views

How to split and recombine stdout pipe in bash?

I am parsing text on the command line. How can I take the output of one command and use it in two places in the next command? some_command | head -n $( awk '/search_term/ {print FNR} ...