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 [tag:io-redirection] for questions on how to redirect output, use [tag:file-descriptors] for questions on how to manage file descriptors, use [tag:...

learn more… | top users | synonyms

1
vote
2answers
31 views

has a file changed of value [on hold]

im trying to use pyinotify to detect if a file has changed. managed to do it this way def status(argument): global email_alarm_status global new_email_alarm if not email_alarm_status: ...
0
votes
1answer
39 views

Capture stdout from ssh session to local machine

I am having to put together a script that will ssh into devices to run a command such as "show running-config" and save the output to a file on my local machine. I have done similar tasks like this ...
1
vote
2answers
65 views

where is the location of stdin, stdout, stderr file descriptor in AIX(unix)

In my Linux environment, the file descriptors are located on /dev/fd. Where is the location of stdin, stdout, stderr file descriptor in AIX(unix). I couldn't find them.
0
votes
2answers
24 views

Bash scripting: Change standard error message for custom one

I have been trying to work on my own little backup script. I am running into an issue when I run my script and the rm command has nothing to do. I would still like to process the output (aka display ...
0
votes
1answer
36 views

How to print all MAC addresses of devices interacting with wifis in my area to stdout

How do I configure a tool like wireshark, kismet, tcpdump to passively listen to wifi traffic? How do I get one of these tools to print these MAC addresses to stdout? I want just one MAC address per ...
2
votes
1answer
31 views

Print stderr only if nothing gets written to stdout, otherwise print just stdout discarding stderr

There's a command that always prints stuff to stderr. Such information is never useful except when it doesn't write anything to stdout. So, is there a simple shell way, tool or command to help ...
3
votes
4answers
357 views

How to slow down the scrolling of multipage standard output on terminal?

On a cluster where I am part of the management team, I often have to go through the multipage standard output of various commands such as sudo find / to look for any troubles such as broken links or ...
0
votes
1answer
32 views

System messages in vim

O/S: Arch Linux (Kernel 4.3.3-2-ARCH) While editing files with VIM 7.4 it occassionally happens that system messages appear on the screen, ruining my workflow but obviously not altering the ...
0
votes
1answer
22 views

Redircting stdout to file, but duplicating stderr to both file and terminal [duplicate]

Redirecting stderr to file and duplicating stdout to both file and terminal is easy: $ prog 2>error.log | tee output.log tee will duplicate stdout, printing it to both terminal and output.log. ...
2
votes
1answer
105 views

How to sort files separately without merging?

File1: Brazil New Zealand Argentina Uruguay File2: Chile Russia Latvia Switzerland I realize that the command sort -n File1 File2 will sort all the files merged together and display it ...
0
votes
0answers
31 views

save outputs and errors to external file from lxterminal

I run compiled python program like this on my linux box (runs automatically after start lxterminal LXDE lxsession autostart): @lxterminal -e sudo /home/user/app.exe > /home/user/app.out 2>&...
20
votes
4answers
1k views

How to invoke vim editor and pipe output to bash

Sometimes I need to write text and then pipe that text into another command. My usual workflow goes something like this: vim # I edit and save my file as file.txt cat file.txt | pandoc -o file.pdf # ...
1
vote
1answer
53 views

System is no longer outputting UTF-8 characters

I just had an issue with my server where it responded incredibly slowly, so I forced it to reboot over SSH. When I connected back, I found out my system no longer outputs certain characters correctly. ...
8
votes
5answers
495 views

Is there a tool to dynamically redirect output to a new file on request

I'm currently redirecting the output of a monitoring tool to a file, however what I'd like to do, is to redirect this output to a new file on my request (using a keybinding), without stopping the said ...
2
votes
1answer
57 views

non-blocking/multi-threaded cat

cat is blocking from what I see in the code, i.e. it uses blocking read() and then it uses blocking write(). I want to call some tool where I disable all stdout buffering by purpose (e.g. like ...
3
votes
2answers
46 views

stdbuf supposed behavior for subprocesses

I didn't exactly find something about the following in the man-page. How is the supposed behavior in subprocesses spawned by a process which was itself spawned by stdbuf? E.g.: stdbuf -oL myprog ...
0
votes
1answer
59 views

How do I output stderr/stdout of my script to both a file and the console?

I'm using Amazon Linux and writing a script in bash. I want to output both stderr / stdout (preferably in the order that they occur) to a file as well as the console. However, this command isn't ...
2
votes
1answer
51 views

Unable to redirect stdout/stderr to log file [duplicate]

I have a script tmp.sh #!/bin/bash echo hello sleep 3 echo 3 I want to log the script running time (as well as script stdout) to a log file. user$ time ./tmp.sh >& log.tmp real 0m3....
3
votes
2answers
128 views

What are the default stdin and stdout of a child process?

I would like to know what are the default stdin and stdout of a child process (if there are such defaults). Are stdin and stdout of a child process the same as its parent process? Is this something ...
1
vote
1answer
32 views

Save number of lines output to a variable in a shell script without consuming the output

I have a shell script where I have a if statement based off of the number output lines output from another call. (In my case do something there is more that 1 line of output). LINES=$(function_call | ...
1
vote
2answers
20 views

redirect the output of {time}

I am trying to benchmark a single request agains a webserver, and am having a problem doing so, specifically, I am having an issue redirecting the output of the time command. If i simply run time ...
0
votes
1answer
21 views

Check if stdout is attached to a terminal from an AWK script

Is there any way I can check if an AWK script's stdout is attached to a terminal, just like test -t 1 in a shell?
0
votes
2answers
81 views

Will the stdout output of a background process be taken as the stdin input of the foreground process?

When a background process outputs to stdout to appear on terminal, will the output be taken as stdin input to the foreground process? Note that the background and foreground process are not related by ...
0
votes
2answers
94 views

Redirect stdout to file with nohup doesn't work

I'm trying to run a C-program in the background. I also want to save the stdout-outputs of the program. But if I try the following, nohup only redirects stderr-outputs to the logfile.txt: nohup ./...
1
vote
2answers
34 views

I want to catch the STDERR and STDOUT of Background running script

I have to run a script background and also i have to catch the STDERR and STDOUT . i'm using the below line . test.sh & >> log_file 2>&1 But un fortunately nothing is getting ...
3
votes
3answers
117 views

Direct output to pipe and stdout

I was wondering if there is a way to pipe the output of a command and direct it to the stdout. So for example, fortune prints a fortune cookie and also copies it to the clipboard: $ fortune | tee &...
1
vote
1answer
98 views

`docker logs foo | less` isn't searchable or scrollable but `docker logs foo 2>&1 | less` is

Using either one gives readable text. But only with the stderr redirect can one scroll or type /somepattern and get matches. Without it searching gives "Nothing to search (press RETURN)" and a ...
0
votes
0answers
19 views

Where is the logging of an application launched from the GUI buffered before being sent to a log file?

This is a fairly difficult question for me to word, but I'll try my best. When I launch an application from the terminal, say, Banshee as an example (so banshee to launch from terminal), I can see ...
1
vote
2answers
259 views

Read from and write to file from stdin and stdout

I need to continually read from and write to a (virtual) file in bash, without closing the file in between. I'm looking for a program which will open the file for read and write, read from stdin and ...
1
vote
1answer
23 views

Prevent script from generating stdout if called from given program

I want my gnome-terminal to show my current user and host in its titlebar, and that of the remote when I am using ssh. To do that, I created a script ~/bin/ssh, with ~/bin in my PATH before /usr/bin: ...
4
votes
3answers
196 views

Trying to make sense of bash redirection syntaxes and their outputs

I'm new to Linux and trying to understand how redirections work. I have been testing various syntaxes for redirecting stdout and stderr to the same file, which don't all produce the same results. ...
3
votes
2answers
69 views

vim: Force specific syntax via command-line argument

When I want to easily read my PostgreSQL schema, I dump it to stderr and redirect it to vim: pg_dump -h localhost -U postgres dog_food --schema-only | vim - This gives: vim does not have a ...
1
vote
2answers
82 views

shell stderr to /dev/null

I have PID file and I want to get PID number so this is what I am doing. [root@linux ~]# PID=`cat /usr/local/foo/var/run/foo.pid` [root@linux ~]# echo $PID 3414 sometimes this file doesn't ...
0
votes
1answer
43 views

Create a two line text file without anything written to stdout

So basically I want to write a two line file containing this: This is line one This is line two I can easily do this by doing this command in bash: echo "This is line one\nThis is line two" > ...
2
votes
2answers
64 views

How to store the printout of the last command in a shell variable in urxvt/zsh?

I'd like to have the printout (stdout and stderr) of the last command run within zsh available in a variable ready to use grep, etc on it.
1
vote
0answers
25 views

Suppress warning of rbenv versions if no rubies installed

At the moment I'm working on Ansible role that installs ruby with rbenv. In order not to install same ruby version every time I run setup task I have to check that no needed ruby is already installed. ...
2
votes
2answers
105 views

Output is in console but not part of stdout or stderr

I have a command that outputs the following: READY Listening.... HELLO READY Listening.... TEST It is speech recognition from pocketsphinx_continuous. I need that output redirected to a file, and ...
3
votes
5answers
309 views

Concatenate contents from stdout and from file

How can we concatenate results from stdout (or stderr) and a file into a final file. For example ls -a | grep text1 concatenate with file2.txt into a final result (not file2.txt), without storing ...
16
votes
5answers
1k views

How to trick a command into thinking its output is going to a terminal

Given a command that changes its behaviour when its output is going to a terminal (e.g. produce coloured output), how can that output be redirected in a pipeline while preserving the changed behaviour?...
2
votes
3answers
37 views

What is regarded as “ideal” in relation to using stdout/stderr for output in different situations?

I have seen stdout and stderr used in a variety of different ways - as far as I understand, it is common to use stdout for general information and stderr for errors and the like. However, I have also ...
3
votes
1answer
227 views

vimdiff to compare output instead of files

I am trying to compare two command output (no files) vimdiff "$(tail /tmp/cachain.pem)" "$(tail /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem)" I tried playing with redirection, pipe, and vim - ...
0
votes
4answers
191 views

How to display output of command while also parsing it?

I have two commands, build and deploy. Currently I run build manually, parse its output using my own eyes, and use a value I find in the output as an argument to deploy. The process looks something ...
0
votes
0answers
20 views

Piped sequence - printing

I need to write a piped sequence of commands that prints out a list of all sub directories of a current directory. In order to get all sub directories of a current directory I use: ls -D Since I am ...
0
votes
2answers
477 views

how to redirect output of ssh to a file

I want to make ssh connection to my server but I don't want to enter password. I want to save output to a file like so: $ ssh root@x.x.x.x -p 22 1>output 2>&1 but when I run it the output ...
0
votes
4answers
125 views

How to log from inside the script along with stdout

I am aware that I can log using tee But I want to log from inside my script, at the same time display the content on the stdout. Example, my code looks something like this: names=$(print("name1 ...
0
votes
0answers
110 views

Stop stdout log being clipped (by heroku-local)

I run heroku local with the Procfile: web: start-nginx gunicorn -c gunicorn.conf.py app:app start-nginx does some environment setup, and then ends with: { nginx --some-params & $@ ; } the ...
2
votes
2answers
1k views

pipe stdout-to-file with wc

I'm working on a lab assignment for a class, which exemplifies users | wc -w as displaying the number of users currently logged in. The instructor has asked we write the output of users to a file (...
0
votes
2answers
46 views

Unclear where bash output is going

I made a small script to output the list of vim plugin remotes to a file, so I could figure out what ones I want to keep or remove. However, when I run it, the output doesn't get piped to the file. ...
1
vote
2answers
142 views

Duplicate stdin to stdout and stderr, but in a synchronized way

I need to duplicate the stdout of a producer and feed it to two consumer in a synchronized fashion. consumer 1 producer | duplicator | consumer 2 ...
0
votes
2answers
77 views

Printing on “standard out” and “standard error”

I'm puzzled over some terminology used in my homework: So, the way I understand the question is that I should print echo, cat, etc., which I would do like with the echo command, for example echo ...