Questions tagged [stdout]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
285 views

Why doesn't systemd capture output from subprocesses of a user service written in shell script?

Here is my amazing service, written in shell script: $ cat ~/junk/demoapp #! /bin/bash -eu while true do echo "in shell" ( echo "in subshell" ) /usr/bin/echo "in ...
Tom Anderson's user avatar
0 votes
1 answer
350 views

How can I connect standard output and error of a systemd service to a file with a date in the path?

I would like to run a server process under systemd, and append its standard output and error to a file, where the file path has a date in it, like this: /initech/logs/tps-report-app/sales/2023/09/11/...
Tom Anderson's user avatar
0 votes
1 answer
699 views

Send STDERR to console and file, STDOUT to file only

I have some script with STDOUT and STDERR output. By default, both STDOUT and STDERR goes to console: ./script.sh I can redirect STDOUT to file, leaving STDERR output in console: ./script.sh > log....
AntonioK's user avatar
  • 603
1 vote
1 answer
946 views

how to see the verbose output of a process that is running that writes to a file (shred)

I am running the shred command to securely wipe some storage. I would like to see its progress, but have lost the ssh terminal that was running the command. Is there a way that I can use to see the ...
miller the gorilla's user avatar
1 vote
0 answers
50 views

assign result and status code from wget to variables

Can I get the response and status code and assign them to variables? # wget https://www.google.com --quiet --server-response 1> >(body=$(</dev/stdin)) 2> >(grep HTTP | awk '{print $2}' |...
Richard Barraclough's user avatar
0 votes
1 answer
976 views

How do I get lighttpd access log to stdout?

I am running lighttpd in a docker container on Ubuntu (as a service that must always be up in my traefik setup). My docker-compose.yml contains: lighttpd: image: sebp/lighttpd container_name:...
gctwnl's user avatar
  • 173
1 vote
0 answers
129 views

Given a command whose STDOUT prints to several lines, how might I format each of them (e.g. prepend a string, change a color, etc.)

Okay, so, contrived example here, but it's the simplest instance I could come up with the produces the conditions I'm trying to alter. I'm trying to run a black-boxed command and alter the multi-line ...
NerdyDeeds's user avatar
6 votes
1 answer
10k views

systemd process stdout/stderr

When I run the service manually, it logs something when it starts. But I cannot find this log anywhere when it starts as systemd process. journalctl -u <service> only shows the records about the ...
esp's user avatar
  • 161
0 votes
0 answers
632 views

How to ensure output from "tee" is shown when used in a script run under systemd

I have a script that I'm running under systemd which has some debug logs that I'd like to send to both stdout (which should end up in the system journal, viewable with journalctl) as well as to a log ...
mgalgs's user avatar
  • 345
5 votes
2 answers
26k views

What is the meaning of the "/dev/null 2>&1" in a Cronjob entry?

Can someone explain to me what is the meaning of "2>&1" doing here in the below cron job 0 23 * * * wget -q -O /dev/null "https://example.com/index.php" > /dev/null 2>&...
mahen3d's user avatar
  • 4,422
3 votes
1 answer
984 views

Showing message to the user during a Debian unattended preseeded installation

During the late_command step of an unattended installation, I'm running a shell script : d-i preseed/late_command string in-target /bin/sh -c './execute-script.sh' When the late_command step is ...
Bil5's user avatar
  • 153
3 votes
1 answer
5k views

Supervisord services not outputting to docker-compose console

I have a docker container that runs several services inside it. I want each service to have it's output sent to the console. The is a development container so I want to see all output as I work. I ...
Guerrilla's user avatar
  • 263
1 vote
1 answer
145 views

stdout does not display `rpm -qa` output without redirect

On a SLES 12 virtual machine the command rpm -qa does not return anything to stdout. ~> rpm -qa ~> The command finishes after 1 or 2 seconds, so it clearly generates some data. Only when the ...
TheCooocy's user avatar
  • 141
0 votes
1 answer
547 views

Linux does STDOUT | STDIN piping write data to disk?

I was planning on passing encryption keys to zfs load-key pool/set through stdin. The keys passed are generated by another program in HEX format and dataset is configured to have keylocation=prompt, ...
The amateur programmer's user avatar
0 votes
1 answer
2k views

Unable to write to `stderr` or `stdout` from Kubernetes pod to pod logs

I'm trying to debug why my application logs aren't being picked up by Promtail for ingestion into Loki. In order to exclude the complexities of my PHP application logging being the culprit, I'm ...
Alex's user avatar
  • 101
14 votes
1 answer
19k views

Ansible display realtime shell stdout

I want see the realtime shell stdout, instead of registering in a variable and then display once it is completed. Example Playbook - test.yml - name: Testing RUN Shell Command hosts: localhost ...
Veerendra K's user avatar
0 votes
2 answers
755 views

Can't redirect awk output to a file... tried everything

I created a nice little command to measure data bandwidth consumption over a metered connection (excluding local traffic): sudo iftop -i enp1s0 -f 'not (src net (10 or 172.16/12 or 192.168/16) and ...
Achis K's user avatar
1 vote
1 answer
247 views

Redirect rpccclient output

This is such a simple task I must be overlooking something. I am using rpcclient to dump some data and I cannot seem to figure out how to redirect the output to a file. The standard > doesn't ...
Joe's user avatar
  • 161
0 votes
1 answer
208 views

Bash command stdout

I'm trying to get a software version by using the bash script. The Command is simple: /usr/local/sbin/keepalived -v This is the output: Keepalived v2.0.13 (02/18,2019), git commit v2.0.12-53-...
Ilie Soltanici's user avatar
7 votes
1 answer
11k views

SSHd logs in Docker container not shown by `docker logs`

When using CMD ["/usr/sbin/sshd", "-D"] in a Dockerfile, docker logs does not show the logging: cat > Dockerfile.stdout <<EOF FROM alpine:latest RUN apk add --no-cache openssh-server \ ...
Willem's user avatar
  • 187
0 votes
1 answer
567 views

Short syntax to display all Nginx logs at once aesthetically, in stdout

This is how I display all Nginx logs at once aesthetically (with headings and spacing), in stdout, for comfortable debugging. Input: printf '\n\n General: \n\n'; nginx -t; printf '\n\n Access: \n\n';...
Arcticooling's user avatar
-1 votes
1 answer
119 views

stdout and stderr from bash execution to other machine?

Is it possible to send stderr or stdout from a linux machine to ubuntu linux machine using at best wget or other common package at worse ( hopefully not ssh access ) ? So far i can find a way to "...
eugeneK's user avatar
  • 410
1 vote
1 answer
6k views

Debugging rsync over SSH in verbose mode using tee to redirect stdout to log file

I have been having issues with various rsync operations over SSH, on a particular machine on our network, failing and giving errors like: rsync: connection unexpectedly closed (45482 bytes received ...
PicoutputCls's user avatar
0 votes
1 answer
1k views

Dovecot quota-warning executable can not log to stdout

I'm running dovecot with DB based userdb and passdb inside a docker container using the s6-overlay. Everything runs very well. Now I tried to add quota warnings and run into a problem with logging to ...
Michael Härtl's user avatar
2 votes
1 answer
4k views

Tomcat has stopped generating stdout logs

We have tomcat server in our production environment. Suddenly tomcat has stopped generating stdout logs. Last generated log by tomcat is one month ago and the size of stdout log file is 5006 KB. What ...
Pawan Patil's user avatar
0 votes
4 answers
571 views

Sudo redirected stdout file ownership

I am redirecting stdout from a sudo. However, the file ownership of the output file is the user who ran sudo, not the sudo target user. I'm logged in as 'root' for the command below: sudo -u ...
Dave Westerman's user avatar
0 votes
2 answers
3k views

Capture outputs with bash to log it and alert user

I am modifying a backup script to save multiple servers with multiple services and different configurations using bash on an Ubuntu server. I save outputs from commands into a log file and sent these ...
Loenix's user avatar
  • 101
3 votes
3 answers
1k views

Grep regex Stdout to telnet

I'm trying to use grep to get a regex result and pipe the results on-the-fly to telnet running an open port to a node server. The grep received continuous, but varied in interval, commands from a ...
kirgy's user avatar
  • 179
0 votes
1 answer
904 views

When use "exec 1>ok.log", how can I output the specified content to the screen within a shell script?

As follow, I only want the command echo "this is to stdout" output to my screen instead of to the file ok.log, how can I do? I search for the usage of exec shell command, but without result, please ...
jython.li's user avatar
1 vote
1 answer
369 views

How do I pipe stdout and std error to a file and back to stdout on Windows?

On Windows when running a batch script I want to record the output of I run: myprogram.bat 1> mylog.log 2>&1 Which is great - but I have to run a separate tail process to read the output ...
Hawkeye's user avatar
  • 2,729
0 votes
2 answers
725 views

Streaming stdout

I have a script that outputs a lot of debug data that I would like to avoid to save on disk (specially since the file system is on a flash memory card). So I run it on the background with nohup + &...
Sdlion's user avatar
  • 101
0 votes
1 answer
34 views

Make init script output available without hitting the filesystem

I'm working on an init script for a command which writes extensive activity messages to stdout. The output is only useful for debugging and since it will be running on a Pi, I don't want these ...
svoop's user avatar
  • 145
1 vote
1 answer
2k views

Ansible loops and conditions with arrays

I want to be able to control the behaviour of a module by specifying a changed_when condition. This works fine when executing a simple task like the one in the docs: - command: some command ...
EvilTorbalan's user avatar
1 vote
1 answer
769 views

How to append unix timestamp to each line output file

I'm running the following command and storing the stdout into a text file. I need to add unix timestamp to each line output file to figure out start and end time of each operation. $ ./bin/ycsb load ...
hossein's user avatar
  • 181
0 votes
2 answers
3k views

ansible tower reports : stdout capture is missing

How to fix the error of stdout capture being missing. I am scheduling couple of tasks, initially they are running fine after couple of iteration it is throwing this error.
Naveen Vijay's user avatar
-1 votes
1 answer
883 views

autostart rc.local 2>&1 redirect, 'open /dev/tty: No such device or address'

I'm trying to execute this command with rc.local: wget http://address/file -P /root/ 2>&1 | stdbuf -o0 awk '/[.] +[0-9][0-9]?[0-9]?%/ { print substr($0,63,3) }' | whiptail --gauge "Progress" 6 ...
koralgolek's user avatar
2 votes
2 answers
836 views

Unable to channel docker-registry stdout to log file

I've been trying (rather futilely) this afternoon to try and stop docker-registry from writing to stdout but rather a log but I think the underlying Python is creating processes which seem to bypass ...
Dave Mackintosh's user avatar
1 vote
0 answers
88 views

Losing stdout when process restarts itself in windows

I have for example a NodeJS process running with Nodemon, and all the output redirected to a file. nodemon example.app > 123.log When I change any file in the node app, the NodeJS process is ...
marty's user avatar
  • 41
4 votes
1 answer
2k views

BASH: alternatives to coproc [closed]

I have some scripts which use coproc to control stdout/stdin of subprocesses. Unfortunately, coproc was introduced in Bash 4.0, and on many systems I use, there is an earlier versions of bash. Are ...
Dog eat cat world's user avatar
2 votes
2 answers
4k views

Log rotate log from standard out

I have a program which takes an argument to allow extra debug from a piece of hardware we use. The log is just written to standard out so normally we just pipe the standard out to a file i.e. ./...
Boardy's user avatar
  • 268
3 votes
2 answers
3k views

logging/capturing STDERR/STDOUT on Amazon EC2

I'm looking for a solution that would allow me to automatically capture the STDOUT/STDERR of a process running on Amazon EC2, and send it (remotely) to another server. Sound simple, except: I will ...
user205122's user avatar
261 votes
6 answers
596k views

How to see stdout of ansible commands?

How do I see stdout for ansible-playbook commands? -v only shows ansible output, not the individual commands. It would be great if I could figure out how to do this immediately, so if something ...
QuinnBaetz's user avatar
  • 2,719
0 votes
1 answer
57 views

How to prevent printing of "debug path" in stdout?

Sys Vers: ubuntu precise 12.04 LTS I seem to have a config setting that forces an executable to log to stdout (or stderr) the current directory it walks through. All commands execute successfully ...
nicoclavier's user avatar
-1 votes
3 answers
165 views

Redirecting process output to a file per date

I'm currently redirecting all my service's standard output (stdout and stderr) to a single file, by starting is as such: java blablaargs &> service.out SVCPID=$! However, that file grows ...
Bart van Heukelom's user avatar
1 vote
0 answers
892 views

Display only the last line of a windows command line executable

I'm trying to write a batch script that manages simple software deployments. One of the steps in the script compresses a file structure into a 7zip archive. During the compression process, the z7ip ...
munroan's user avatar
  • 11
0 votes
1 answer
2k views

Can't redirect STDERR or STDOUT to file

I have application written in Go language and it runs in screen (I do not think problem relates to Go language. I believe it uses STDOUT and STDERR) screen -S log_server -d -m go run log_server.go 2 &...
Max's user avatar
  • 133
8 votes
4 answers
1k views

Should a foreground program invoked by a daemon split logging between stderr and stdout based on severity levels?

Usually log messages are written to stderr. I'm wondering if it is a good idea/practice to split log messages so that errors and warnings go to stderr while debug/informational/notice messages go to ...
Rio's user avatar
  • 335
0 votes
1 answer
972 views

IIS7 and PHP: Show error messages with all the rest of the output

Okay, this is slowly getting annoying. I'm used to work with Apache Webservers and never had any of these problems. IIS seems to try to be intelligent - or whatever. Here's my situation: My customer ...
BlaM's user avatar
  • 3,936
11 votes
4 answers
10k views

Is there anyway to get msiexec to echo to stdout instead of logging to a file

As part of a continuous delivery pipeline I'd like to install an msi on a given machine. msiexec plus psexec does this perfectly, but it seems that msiexec can only log to a file and I need it to log ...
mrmrcoleman's user avatar
2 votes
2 answers
6k views

Windows cmd stderr redirection to stdout while keeping output to stderr?

Is there a way in Windows 7 cmd shell to redirect the stderr to stdout while keeping the stderr stream intact? For example, I have a program that outputs to stderr and stdout the following message ...
Stecy's user avatar
  • 122