We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [stdout]

The tag has no usage guidance.

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

systemd service output to terminal/pty

I am not able to figure out what option to pass in StandardOutput= for a unit file (.service), where I want to show some messages on the connected terminal from where the service is started! (console/...
2
votes
0answers
35 views

OS laggy after echoing a string in file descriptors 0,1,2 (stdin, stdout, stderr)

I was trying to exploit capacity leaking to a C program (see below), by taking advantage of the non-existence of fclose() function to a file, that the program previously opened. In short, the ...
1
vote
0answers
32 views

Is there a terminal utility that I can use to 'occasionally' record stdout for long running processes?

An example would be the badblocks. Just now I was using it as sudo badblocks -sv /dev/sdb This utility takes a long time to work. Particularly for large disks from years ago that aren't in the best ...
5
votes
2answers
558 views

Piping the output of comand columns

I am using lolcat to get the output of ls in color. To do this i have copied /usr/bin/ls to /usr/bin/lsslss (to avoid an endless loop since alias cannot acccept $* or $@) and I have added the function:...
0
votes
0answers
29 views

Service program output redirection

I have programm that starts in startup script. It prints to stdout and stderr some information that is not visible when system starts. Can I find somewhere information that was sent to stdout stderr ?
11
votes
3answers
1k views

What is the meaning of & at the end of a command?

I have a startup script line: pyprogramm >> /dev/null 2>&1 & Meanings: >> /dev/null - redirect stdout to null device 2>&1 - redirect stderr to stdout (that is ...
-2
votes
1answer
76 views

What is the stdout output in stream-redirection labs?

Inside the ‘stream-redirection’ folder there is a program called ‘program’. When you run this it will output to stdout and stderr. What is the stdout output? I have tried ./program, but it did not ...
3
votes
1answer
201 views

Bash file redirection bug?

From what I understand about program IO, there are stdin, stdout, and stderr data streams (and a return code). stdout and stderr are the two data output streams. So if I use bash redirection to close ...
0
votes
0answers
70 views

need help with commands in terminal [duplicate]

I am stuck trying to figure this out. the question for my homework goes like this: For this question, run the script at /var/standardStreams.sh. This script will create some output text on different ...
1
vote
0answers
81 views

Print netplan config

Does netplan have any options available for writing how it interprets its config files to stdout, an arbitrary directory, or something similar? The context for my question is that I'm updating a ...
0
votes
0answers
27 views

Output logs to dynamically created folder structure (based on the current date), using upstart to create the service

I have the following upstart configuration: start on runlevel [2345] stop on runlevel [06] respawn respawn limit 99 5 #respawn is used to start the nodejs again, even if it fails. env NODE_ENV=...
0
votes
0answers
283 views

Error message was neither redirected to STDERR nor to STDOUT, but it was really exist when output logs to screen?

The following commands were ran in Ubuntu 16.04 and the version of python is 3.5. When I ran the python routine without data redirection python3 opt_CNN2_dense.py Screen output ResourceExhausted ...
0
votes
0answers
115 views

Communicating with background service

I have a process registered as a service running in the background which occasionally logs to stdout. It is some linux executable which, if run in the foreground, can receive user commands and respond ...
1
vote
2answers
478 views

bash retry function with silencer

I found a bash function, that let's me retry commands. function retry { local n=1 local max=50 local delay=1 while true; do "$@" && break || { if [[ $n -lt $max ]]; then ...
0
votes
1answer
740 views

Git produces output in realtime to a file but I'm unable to echo it out in realtime directly in a while loop

What I want My actual long term goal is bypassing all the output of a git process into another function (in order to make a progress bar - see my older question for more details about that). What I'...
2
votes
2answers
10k views

How to get git producing output to a file?

I wanted to write the output of git clone to a file using git clone https://github.com/someRepository > git_clone.file But instead I get the output displayed/updated in the terminal like ...
0
votes
0answers
126 views

Pipe stdout through sed or awk command BEFORE redirecting to file? [duplicate]

I am still kind of new to programming, but willing to learn: I am struggling with a problem in following project: I am logging analog read-outs of an Arduino board. The Arduino board sends tab-...
0
votes
0answers
166 views

How to stop file-roller from outputting anything and hanging on the process

I'm writing a program that uses file-roller to extract an ISO file. However I keep getting a warning and I don't want to see this warning. Also file-roller hangs after this warning. Gtk-Message: ...
2
votes
1answer
2k views

using ffmpeg in bash script prints video data to stdout

I'm writing a bash script to convert some videos the problem is when I run ffmpeg directly in terminal it is OK and converts video correctly but when I use it in bash script it prints lots of data (...
0
votes
1answer
496 views

grep in bash-script doesn't print message in log file

I'm trying to write the output of a command to a log file using grep: ./exeFile dir1/file.conf | grep textError > logTest.txt & But it doesn't write anything to the log file. If I use ./...
1
vote
1answer
91 views

How to write the most recent line of a process to a readable file

I’ve got a question for you that is theoretical. While running a process in the terminal I often just care about the most recent last line. And I want to call the data in that line from another ...
3
votes
2answers
947 views

example of console output that is not written to standard output

It seems read does not write to standard output. $ cat test.sh #!/bin/bash read -p "type a key and Enter" key echo "the key was $key" $ ./test.sh type a key and Enterx the key was x $ ./test.sh | tee ...
1
vote
1answer
3k views

How do I save a shell's stderr and stdout to a file while still having it output to the terminal window? [duplicate]

I need stdout and stderr to a file, and my shell simultaneously. command > file.txt, the usual goto, will not output stderr to the file, nor output stdout to the terminal. command > file.txt &...
0
votes
1answer
44 views

How can I set the terminal to not automatically go to the last line if there the output in the terminal has been updated?

I have some programs that are continuously outputting data on the terminal. I however want to be able to scroll up and down while the program is outputting all this data to the terminal, but every ...
0
votes
1answer
236 views

How to use the output of ettercap

To encrypt tshark output, I use tshark -w - | gpg -e > capture.pcap.gpg How do I do the same for ettercap? This command does not work ettercap -M arp -w - -T //// | gpg -e > capture.pcap....
3
votes
2answers
1k views

How to redirect dd progress in terminal to a log.txt file but still display it on the terminal during the process?

Here is my script :- sudo mate-terminal --geometry=50x10 -x sh -c "dd if=/dev/sda of=/dev/sdb status=progress 2>&1 | tee log.txt | md5sum > hash.txt | sha1sum > hash1.txt" I've seen ...
3
votes
2answers
10k views

STDOUT and STDERR redirection for nc

I am trying to make a watchdog bash script which has to check if the port is open, based on the exit status, otherwise should start the daemon. Problem is I can't manage to avoid the script outputting ...
-1
votes
1answer
88 views

Some programs print errors to stdout instead of stderr, and don't set $? when an error occurs. Why? [closed]

See title. I've seen this twice recently, with both udisks and pacmd, and they are 100 times harder to script because of it. Why do programmers do this? For example, I want to switch the audio output ...
0
votes
1answer
58 views

Why is stdin/stdout failing with gplay on ubuntu?

I am trying to change gplay's volume level programmatically in a Java app. The video plays fine; I see gplay's menu; I get my first "Playing" prompt, and I write a "v" for "[v]Volume" but I never see ...
3
votes
1answer
356 views

stderr of terminal in red, even with sudo

I am trying to make a working example for logrotate, and to help me through this I figured it was a good idea to turn stderr to red. Through some reading, I came upon stderred, which I meant to adopt....
0
votes
1answer
176 views

run a command, send output to mail with stderror colored

I have a script that writes to the STDOUT and STDERR. I can pipe the script to mail so it sends me an email of the output. What I want to do now is have the STDERR of the output colored such that the ...
0
votes
1answer
73 views

Why does man -P behave differently when the output is redirected or piped?

man -P whoami ls This command will output user's name, just like whoami. But when you use pipe to redirect it to a file or to your screen like man -P whoami ls | cat or man -P whoami ls > file, ...
1
vote
0answers
404 views

run a process in background and give stdout for it even if terminal is closed

I found some link here(Hide stdout of a process only when it is running in background) about redirecting running process' output but my case(a module logging to stdout) is a bit different. Cause I am ...
11
votes
2answers
7k views

systemd on 15.04 won't log stdout of unit

I'm currently trying to make a systemd unit as a web server. Currently, my foo.service file looks as follows: [Unit] Description=The Foo Web Server [Service] Type=simple ExecStart=/opt/foo/.cabal-...
2
votes
1answer
2k views

How to copy the stdout of a command to the clipboard in a default Ubuntu installation?

I ran up against this question, and i found it quite interesting. While researching for that, i found out that a solution had been posted already here on AskUbuntu, plus multiple times on ...
0
votes
1answer
155 views

Upstart and isstty(STDOUT_FILENO)

Many Linux programs use istty to determine whether STDOUT is a terminal or not. For example, ls will (by default) suppress coloured output if it's redirected (istty == 0). When running upstart jobs, ...
0
votes
1answer
58 views

Could someone explain what the following command does?

Could someone explain me what the following command does? find / > allfiles.txt 2>/dev/null
1
vote
1answer
159 views

untar content of folder from tar.gz archive that gets data from STDOUT (wget)

I want to extract the content of a single folder from a tar.gz archive that gets its input from the STDOUT of wget. My command looks like this: wget -O - http://example.com/file.tar.gz | tar -C /...
1
vote
2answers
3k views

printf, redirection, crontab

I'm having trouble redirecting C printf statements to a file with a program running as root. I have a program with several informational printf statements and other libraries which print errors via ...
3
votes
1answer
990 views

When piping output to a file, why are stderr and stdout in the wrong order?

I have a perl script: warn "1\n"; print "2\n"; warn "3\n"; print "4\n"; I pipe the output to a file: perl script.pl &> foo cat foo: 1 3 2 4 Why isn't the output in order, and how do I fix ...
247
votes
4answers
435k views

What does 2>/dev/null mean?

I would like a brief explanation of the following command line: grep -i 'abc' content 2>/dev/null
0
votes
1answer
2k views

“Bad file descriptor” with /dev/stdin using dd

I've been using this method (Running off a live CD on both ends, and in root shell, as suggested in another of my questions) to clone one computer I've got set up to my liking to four others with the ...
1
vote
2answers
360 views

Redirect stdout and stderr so that it is displayed or stored nowhere

I want a process to just NOT print its stdout or stderr output. I know that I can do something like program >output.txt 2>errors.txt and then rm output.txt errors.txt but its not elegant. I want ...
2
votes
1answer
399 views

How to make everything on stdout be read aloud (using espeak)?

I've got the eSpeak TTS system up and running, and I like it quite a bit. I'm wondering, is there a way to pipe EVERYTHING that gets printed to STDOUT to espeak? I'm trying to set up a system without ...
12
votes
2answers
42k views

How can I view stdout/stderr of a startup application?

Some of the commands that I have in Startup Applications do not start properly when I login. (In particular I am having trouble with gtk-redshift.) In order to debug, I would like to be able to view ...
1
vote
2answers
2k views

Directly compress stdout

can someone tell me if is possible to directly compress stdout? I would like to do this in one step without creating temporary file files.txt... Example: cat file* > files.txt tar -czf files.tar ...