Questions tagged [stdout]
The stdout tag has no usage guidance.
73
questions
1
vote
2
answers
72
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 ...
0
votes
1
answer
46
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/...
0
votes
1
answer
91
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....
1
vote
1
answer
264
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 ...
0
votes
0
answers
27
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}' |...
0
votes
1
answer
657
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:...
1
vote
0
answers
102
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 ...
5
votes
1
answer
8k
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 ...
0
votes
0
answers
528
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 ...
5
votes
2
answers
21k
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>&...
3
votes
1
answer
825
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 ...
1
vote
1
answer
4k
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 ...
1
vote
1
answer
137
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 ...
0
votes
1
answer
452
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, ...
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 ...
12
votes
1
answer
17k
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
...
0
votes
2
answers
651
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 ...
1
vote
1
answer
215
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 ...
0
votes
1
answer
202
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-...
6
votes
1
answer
10k
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 \
...
0
votes
1
answer
533
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';...
-1
votes
1
answer
108
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 "...
1
vote
1
answer
5k
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 ...
0
votes
1
answer
997
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 ...
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 ...
0
votes
4
answers
516
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 ...
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 ...
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 ...
0
votes
1
answer
836
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 ...
1
vote
1
answer
332
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 ...
0
votes
2
answers
696
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 + &...
0
votes
1
answer
31
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 ...
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
...
1
vote
1
answer
747
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 ...
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.
-1
votes
1
answer
871
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 ...
2
votes
2
answers
817
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 ...
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 ...
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 ...
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. ./...
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 ...
255
votes
6
answers
574k
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 ...
0
votes
1
answer
54
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 ...
-1
votes
3
answers
155
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 ...
1
vote
0
answers
881
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 ...
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 &...
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 ...
0
votes
1
answer
955
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 ...
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 ...
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
...