Questions tagged [stdout]

Stdout is the standard output stream is the default destination of regular output for applications.

119 questions
521
votes
11 answers

Can I make cURL fail with an exitCode different than 0 if the HTTP status code is not 200?

I was always assuming that when curl got an HTTP 500 response it was returning an exit code that meant failure (!= 0), but that seems to be not the case. Is there a way I can I make cURL fail with an exitCode different than 0 if the HTTP status code…
knocte
  • 5,481
  • 2
  • 15
  • 19
295
votes
5 answers

How do you redirect wget response to standard out?

I have a crontab that wgets a PHP page every five minutes (just to run some the PHP code), and I want to send the output of the request to standard out, while sending the normal wget output to /dev/null (or otherwise hide it). I couldn't find it in…
Sean Adkinson
  • 3,275
  • 3
  • 17
  • 13
74
votes
11 answers

Log rotation of stdout?

I have a Linux program which can write information to stdout and stderr. I have a shell script which redirects that output to a file in /var/log. (Via >> and 2>&1.) Is there a way to make that log file rotate? (max size, then switch to a different…
Miral
  • 1,189
  • 1
  • 9
  • 12
42
votes
3 answers

How to tar/untar the output on the fly

What is the idiomatic way to do the following tar to stdout read this tar output from stdout and extract to some other folder. My solution is tar --to-stdout .. | tar -C somefolder -xvf - But may be there is more idiomatic way to do it.
shabunc
  • 810
  • 1
  • 8
  • 15
39
votes
3 answers

tee for Windows?

Does Windows provide the basic tee facility for copying standard input to an arbitrary set of files and then back out to standard output? I generally download a generic tee program, but curious if something like this exists in powershell or…
Jé Queue
  • 850
  • 2
  • 13
  • 21
39
votes
4 answers

Windows: Command line redirection to text file while also seeing output

I'm writing a C program in Windows, my printf calls print to the command line, and I know that I can redirect all this output to a text file using: myProgram.exe > mylog.txt However, I wish to also see the output that would have been printed to the…
user79397
  • 493
  • 1
  • 4
  • 5
33
votes
4 answers

Determine if output is stdout or stderr

How can I determine if what a process is outputting is stdout or stderr?
Rauffle
  • 644
  • 2
  • 7
  • 13
30
votes
3 answers

Pipe gunzip and mysql to gunzip a dump and import it

I have a .gz sql dump file (example: foo.sql.gz) that i want import in my database with the classic mysql command. gunzip -c foo.sql.gz > foo.sql mysql -uroot -ppassword foo < foo.sql foo is the database. How can i pipe these two commands in a…
apelliciari
  • 423
  • 2
  • 5
  • 7
26
votes
5 answers

Watching something be written to a file live with tail

I have a python program which is, slowly, generating some output. I want to capture that in a file, but I also thought I could watch it live with tail. So in one terminal I'm doing : python myprog.py > output.txt and in another terminal : tail -f…
interstar
  • 843
  • 1
  • 10
  • 17
25
votes
1 answer

Copy terminal output to Mac clipboard?

I need to directly copy the terminal stdout to the clipboard on Mac. How would I do this? Example: echo sometext | copy_to_clipboard or echo sometext > /private/clipboard.txt
t3hcakeman
  • 351
  • 1
  • 3
  • 3
22
votes
4 answers

Why does the output of some Linux programs go to neither STDOUT nor STDERR?

Why does the output of some Linux programs go to neither STDOUT nor STDERR? Actually, I want to know how to reliably capture all program output, no matter what 'stream' it uses. The problem I have is that some programs do not seem to let their…
Will Sheppard
  • 567
  • 1
  • 7
  • 18
21
votes
3 answers

Windows how to redirect file parameter to stdout? (Windows equivalent of `/dev/stdout`)

Windows console: Tool A can write binary data to a file, but has no option for telling it to use stdout. Tool B can read binary data from stdin and process the info in it. How can I get the output from A piped through B without using an…
Jeroen Wiert Pluimers
  • 2,853
  • 10
  • 41
  • 55
14
votes
4 answers

How can I stop cat output immediately despite massive output?

I'm looking for someway to stop the output to STDOUT when I realize a command is wrong. For instance, if I accidentally cat a very large file. Usually it will eventually stop if you hold down ctrl + c, but it takes a long time. Is there a way to…
CHK
  • 567
  • 2
  • 6
  • 14
13
votes
3 answers

Two Programs having their StdIn and StdOut tied

Suppose I have two programs called ProgramA and ProgramB. I want to run them both simultaneously in the Windows cmd interpreter. But I want the StdOut of ProgramA hooked to the StdIn of ProgramB and the StdOut of ProgramB hooked to the StdIn of…
DarthRubik
  • 283
  • 2
  • 11
12
votes
4 answers

Encrypting to standard output with gnupg

I'm trying to encrypt something with gpg -a and return the result to standard out rather than a file. According to the manual, it should be sufficient to omit an --output flag, but that doesn't seem to be the case. When I don't specify an output…
Inaimathi
  • 449
  • 2
  • 4
  • 14
1
2 3 4 5 6 7 8