Questions tagged [stdout]

stdout is the name of the default output file descriptor of a process. Since there is nothing special about `stdout`, you *should not* use this tag. Use the [io-redirection] tag for questions on how to redirect output, use [file-descriptors] for questions on how to manage file descriptors, use [lock] for questions of file locking, and use [files] for general questions on file operations.

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

sed + how to be sure that sed replaced the value correctly

here is a nice example how to replace the value on match key on file str="192.2.34.40:2181,192.2.34.34:2181,192.2.34.32:2181,192.2.34.52:2181,192.2.34.53:2181" sed -i "s~^[[:space:]]*...
0
votes
1answer
18 views

how to enable debug logs in stdout for logstash?

I'm struggling as newbie in logstash, below is some info of my env Logstash Version: logstash-7.16.2-1.x86_64 java Version: openjdk version "11.0.13" 2021-10-19 LTS Logstash Conf input { ...
4
votes
2answers
92 views

Looking for a general split+merge syntax for IO streams

I often want to perform an operation that requires splitting the stdout of a pipeline (let's call it pipeline-before) into two parallel streams; feeding the resulting stream, as their stdin, to two ...
0
votes
3answers
74 views

Using `1>&- 2>&- &' as an alias after a shell command

To run a program with bash in background, with no text output, it is possible to use: 1>&- 2>&- &. I would like to define an alias for this. However, if I write in .bashrc alias ...
0
votes
1answer
26 views

Pipe output of two commands into another script as arguments

ntopng can handle multiple network interfaces and I've a script that takes the name of the interface and outputs it in to stdout. I can pipe this output into ntopng my_packet_tracer.sh | ntopng -i - ...
0
votes
1answer
42 views

Please how do I retrieve files saved in STDOUT after using the extract while downloading function?

I used the below function to download a large tar.gz file and extract it simultaneously. The files are now saved in STDOUT. Please how do I move them to a different file directory? wget -q -O - target ...
0
votes
1answer
44 views

How it comes that ldapsearch output can't be piped

ldapsearch always outputs an authentication message with every query at the beginning: SASL/GSS-SPNEGO authentication started SASL username: user.principal@DOMAIN.NAME SASL SSF: 56 SASL data security ...
0
votes
1answer
31 views

When is it beneficial to add -u to tr?

One of the arguments to the tr command is: -u Guarantee that any output is unbuffered. Under what circumstances is it a good idea to not buffer the output? e.g. should I use -u if I expect each ...
1
vote
2answers
55 views

Capture stdout of a crashing program and shell's "segfault error" message

I have a compiled program main.bin that is supposed to print: hello world another line This program generates a segmentation fault right after printing the first line. If I run it in the shell (zsh), ...
0
votes
1answer
58 views

Debugging ssh connection that prints incorrect characters to terminal what appears randomly after ssh logins

With random occurence for ssh logins into remote terminal ('agetty') there is immediate output of unrelated characters into that ssh session terminal. With periodical repetition these are "hh��...
5
votes
1answer
187 views

On `tty <&1` vs `echo $(tty <&1)` vs `echo $(tty <&2)`

The key statements in the snippet below (i.e. other than those for printing labels and blank lines, for spacing) come in pairs. In each pair, the first and second statements have the forms tty... and ...
0
votes
1answer
244 views

How can I redirect journalctl output from a systemctl --user service to a file?

I need to redirect systemd output (Not the binaries stdout / stderr. I mean the actual systemd output send to journalctl) to a file for a specific user unit. I know the user can view journalctl with ...
0
votes
1answer
33 views

How to redirect running process output from pipe to something else?

Is there any way to redirect stdout (1) from that "pipe" (I don't know exacly how I suppose interpret this, I will be glad if someone could explain how to treat this, or give me some read on ...
0
votes
2answers
103 views

How to capture output that is going neither to stdout nor to stderr?

As far as I can tell, some of the output generated by the command /usr/bin/modulecmd goes neither to stdout nor stderr, as illustrated by the following example: % /usr/bin/modulecmd bash help null >...
0
votes
0answers
25 views

Is there an output character to indicate the end of a command in bash from stdout?

I am trying to build a web-app where i can run a bash terminal directly from the browser. I have got the basic functionality working where i fire up a bash process and redirect the stdout to a ...
0
votes
0answers
39 views

How to show the output for the execution for any command and/or script in stdout and file but keeping the color in the stdout?

For some commands, in the terminal they print with some colors in the stdout, for example: git status mvn help:help -Ddetail=true gradle build Any Linux command (ls [-...], etc) Note: it applies for ...
1
vote
0answers
24 views

systemd NOT directing standard output to a file [duplicate]

Our service-definition, running under systemd --user, begins with: [Service] StandardOutput=append:logs/foo.log StandardError=fd:stdout The service starts without obvious errors and the actual ...
0
votes
1answer
90 views

Why is this shell output cannot be written to a file? [duplicate]

I'm working on a linux pinephone script that would launch a touchpad emulator. In order to do so, I need to compare the output string of: ./TouchpadEmulator /dev/input/event2 /dev/input/event1 once I ...
0
votes
1answer
94 views

Run archived script (.tar) without save it on disk, but commands inside it are not recognized

In CentOS, I would like to run a script which is archived as a .tar file, but when I try to do it, it does not recognize 'read' command. The main idea is run this script without save on disk Listing ...
2
votes
1answer
91 views

How to write less buffer to stdout in interactive mode

My scenario is the following: When I ask the psql program for \help, it pipes its output to less. Sometimes, I would like to keep the help contents while writing my next query. I imagine this could ...
5
votes
1answer
256 views

Why is mawk's output (STDOUT) buffered even though it is the terminal?

I am aware that STDOUT is usually buffered by commands like mawk (but not gawk), grep, sed, and so on, unless used with the appropriate options (i.e. mawk --Winteractive, or grep --line-buffered, or ...
0
votes
1answer
254 views

View live output of remote ssh command [duplicate]

Suppose I have a python script script.py from time import sleep for i in range(3): print(i) sleep(1) print('done') which I want to run on a remote server via an ssh command e.g. ssh me@server ...
0
votes
0answers
29 views

How order of saving data redirected from stdout and stderr streams works?

I'm experimenting with redirecting and I've noticed some problem. I know that when I want to save stdout data and stderr data in the same file I can just use 2>&1 or shorten >& like: ls ...
0
votes
0answers
34 views

Delay in log messages for child processes

I have a java program that prints log messages on console (standard output). When I run this program in linux (debian 9) as a separate process then I see all messages according to program execution. ...
2
votes
1answer
41 views

Redirecting output from within disk operations does not work

I am not able to successfully redirect STDOUT+STDERR on commands that operates with disks. Standard redirecting which always works, is somehow now catching the output. Two practical examples: Example ...
1
vote
1answer
44 views

bash I/O redirection - how to append to stderr

I have a script that loops over some big collection of data and performs some lenghty operations. Then i need to sort | uniq -c its output. So to let it know that its alive, I print a dot every N ...
0
votes
1answer
17 views

Execute Program until specific amount of bytes has been returned on stdout, then terminate

Imagine I have the following program/script ./generate-infinite-byte-stream: #!/bin/bash echo -n 'hello' sleep infinity The infinite sleep command represents a network connection that may or may not ...
-1
votes
1answer
61 views

Redirect a part of mapfile function to stdout but not into the array

Summary: Like we have Stdout Stderr, I would like to create Stdstatus. Stdout can be stored in array and Stdstatus can be printed for user. I didn't know that stderr could be used for other messages ...
1
vote
1answer
85 views

How to check if command had any output (zsh)

I want to print a new line after a command if it had any output (I hope that this will make it more readable once my terminal starts scrolling). I found this: precmd() { precmd() { print &...
0
votes
0answers
260 views

Where does stdout and stderr go in the background

When processes get executed in the background, for example by using systemd to start the processes at startup, why doesn't the stdout and stderr still appear on the terminal when we access the ...
0
votes
1answer
226 views

Spawn a terminal and redirect its stdout to original process

I'm trying to spawn a new terminal, execute a few commands and pipe their output to stdin of the original process. A mwe of what I'm trying to do is the following bash one-liner: $ xterm -e sh -c &...
0
votes
1answer
378 views

The linux boot message in dmesg doesn't output to uart

My problem is my linux is success for boot but there is no more boot message output to uart(ttyPS0) after "Starting kernel...". As you can see in the pic, there is a lot of boot message in ...
-1
votes
1answer
43 views

Downloading a file with a trivial name without overriding a possible existing file with the same name

In CentOS with Bash I download a file with a very trivial file name, install.sh. Although extremely unlikely in my scenario, this could still, in theory, overwrite some existing file with the same ...
0
votes
1answer
40 views

how to get split commands output to file

I want to print output of below command to file, can you help me I tried 2>&1 even 2>> also dd if=/dev/random bs=1 count=1000 status=progress |split -b 10 -a 10 I have other dd command ...
5
votes
1answer
460 views

How to redirect a command's `stdin` as well as `stdout` to the output

Suppose I have the Python script: #!/usr/bin/env python input('Y/n: ') print('Next line') After I press Y, I want both the terminal and my output.txt containing: Y/n: Y Next line Running the ...
2
votes
2answers
631 views

KeepassXC-cli: Send password to stdout

I would like to authenticate to neomutt using keepassxc. I could not find a way to send password to neomutt's stdin. How can i do that ? I imagine something like this: keepassxc-cli exportpass ...
1
vote
0answers
59 views

Display pdftohtml output using elinks -remote option?

The following command works great to view pdf content from the command line: pdftohtml -i -stdout file.pdf |elinks. As should be clear, what's happening is that file.pdf is being converted to html and ...
0
votes
2answers
39 views

how to correctly redirect stdouts to pass file without comments to pacman input

I have a simple file with the following content: # programming python python-pip perl # web firefox firefox-i18n-es-es The file name for this example will be file. I usually use these files that ...
1
vote
1answer
190 views

How to access stdin/stdout from detached program?

I am trying to understand how to access stdin an stdout for a process. I have a remote machine accessible only by SSH and I want to run a terminal based program in the background. That is, I fire up ...
0
votes
1answer
121 views

How do I print slurm variables to standard slurm output?

I want to print the following variables to the standard output file slurm-XXXXX.out produced by Slurm. Right now, I am generating a separate .info file for every job. echo "SLURM Job ID : $...
0
votes
1answer
106 views

Python script has no stdout when started via i3blocks [duplicate]

In i3blocks, I have defined a block like this: ~/.config/i3blocks/config: [test] interval=persist format=json The corresponding executable script: ~/.config/i3blocks/config.scripts/test: #!/usr/bin/...
0
votes
1answer
50 views

ambiguous redirect bash from pipes

I want to delete some docker images w/ a redirection of my previouse command. docker images | grep "2 months ago" | grep -v "mailcow" | awk '{print$3}' just redirect via "&...
1
vote
1answer
344 views

Where does the output go to the command specified in `podman create`?

If I create a container with podman create, I can't seem to find any series of options that show the output of the command I'm running. For example, here we can run a container with "Hello World&...
0
votes
2answers
313 views

redirect stdout and stderr to null in the middle of a chain of '&&'s

TL;DR I've researched this, and you can see what I've found in the More Details and My Attempts section. My command is date && echo "hi 1" && echo "1/0" | bc >/...
2
votes
1answer
160 views

Additional file descriptor for debugging and piped output (logging, metrics, etc)

For a bash script project, I write human-readable log info to stdout/stderr. Additionally, I want to write formatted metrics to a third stream that will be discarded by default but can be redirected ...
1
vote
1answer
63 views

How can processes eliminate escape codes when its output is piped?

That's a pretty weird title but I'm having trouble articulating this question: When I run kitty --version in my terminal it prints its version out to stdout, however the text is styled and colored: ...
1
vote
1answer
113 views

How to redirect stdout to a file without the content displaying in the terminal?

tee shows the stdout in terminal, I don't want it to do that but cant find an option || visible in terminal || visible in file || existing Syntax || StdOut | StdErr || StdOut | ...
2
votes
1answer
533 views

Separate stdout and stderr for `docker run`?

Can I get separate stdout and stderr pipes for docker run? Example: $ docker run --rm -it alpine sh -c 'echo this is stdout; echo this is stderr >&2' \ 2> stderr.txt this is stdout this is ...
1
vote
2answers
109 views

Ordering output when two subshells write to stdout

I have a command of the below form input | tee >(subshell) | mainshell Both subshell and mainshell writes to stdout. So their output is not synchronised. E.g. echo "Hello\nWorld" | tee &...
-4
votes
2answers
174 views

Standard error to standard output - is there other options beside redirection?

I have very limited understanding about standard error and standard output... One of the common methods is to redirect standard error to standard output. Does it mean that error (which usually goes to ...

1
2 3 4 5
9