Questions tagged [output]

The externally observable consequences of calling a program on some input

The output of a program is the set of externally observable consequences of running a program on the given input.

A program's output can be manifested in several forms:

  1. What is printed to and/or
  2. What is written to an external file
  3. What changes are made to the inputs, which are then used in other functions or programs
9797 questions
6
votes
2 answers

Modifying "... | tee -a out.txt" to stream output live, rather than on completion?

I would need to output the output of a command on a file. Let's say my command is zip -r zip.zip directory , I would need to append/write (any of these options would be fine) to a file (let's say out.txt). I got zip zip.zip directory | tee -a…
Blax
  • 500
  • 3
  • 7
  • 18
6
votes
1 answer

Get the output with check_output even with a non-zero exit status

I use subprocess.check_output a number of times in a script of mine, but I just ran into an issue with an external application. OpenVPN in this case. When openvpn is called with the --help parameter, which I want to parse in my script, it returns 1…
boolean.is.null
  • 831
  • 2
  • 12
  • 19
6
votes
1 answer

How can I suppress ALL output from gradle?

I'm writing a script for zsh that essentially just needs to know the exit code of the following gradle command: ./gradlew installDebug. In other words, I don't want any output to the console while running this. I've tried the following: ./gradlew…
jwir3
  • 6,019
  • 5
  • 47
  • 92
6
votes
4 answers

How to save a dictionary into a file, keeping nice format?

If I have dictionary like: { "cats": { "sphinx": 3, "british": 2 }, "dogs": {} } And try to save it to a text file, I get something like this: {"cats": {"sphinx": 3}, {"british": 2}, "dogs": {}} How can I save…
PinkiNice
  • 1,455
  • 2
  • 13
  • 19
6
votes
4 answers

How to write to a file using open() and printf()?

I am opening a file with open(), and need to print to that file using printf with no output to the console. How do I do this? I can successfully create the file, and printf to the console, but that is not correct. int main(int argc, char *argv[])…
user2877117
6
votes
3 answers

How to write into chrome/ie/ff f12 console from c# asp.net application code behind

How can I reproduce JavaScript's console.log() functionality from code-behind in ASP.NET web application?
codemonkeyliketab
  • 320
  • 1
  • 2
  • 17
6
votes
3 answers

Double vs. single quotes using formatted printing in python

So I was going through "Learn Python the Hard Way" and while doing this: formatter = "%r %r %r %r" print formatter % ( "I had this thing.", "That you could up right.", "But it didn't sing.", "So I said goodnight" ) the output was…
Bren
  • 3,516
  • 11
  • 41
  • 73
6
votes
1 answer

Can't redirect command output to file

I've been writing a bash script to install PBIS Open when I execute the following command domainjoin-cli join $domain $join_account $password I can see the output on the terminal. However, if I try to capture the terminal output and save the output…
mpmv15
  • 95
  • 1
  • 5
6
votes
2 answers

Output the console text of a Jenkins job that my Job is running

I tried looking here and here and here. I am using the dsl flow. And I would like to be able to see the console log printed out of the job i'm building within the job I'm running. I tried looking around for examples and I couldn't seem to find what…
BarretV
  • 1,197
  • 7
  • 17
6
votes
1 answer

bash output redirection limits?

I try to concatenate large files (some GB) in bash. I tried cat file1 file2 file3 > result and it didn't work while cat file1 file2 file3 >> result worked. In both occasions the file result didn't exist before and my expectation would be,…
user5119237
6
votes
1 answer

How to get rid of unwanted spacing in Fortran's print output?

It may look like a trivial issue, but I couldn't find any answer through googling. I have this little program : Program Test_spacing_print Integer:: N Real:: A,B N=4; A=1.0; B=100.0 print*,'N =',N print*,'A =',A,' B =',B print…
hbaromega
  • 2,317
  • 2
  • 24
  • 32
6
votes
1 answer

Writing to output without buffering in Julia

What is the way to print data on standard output without buffering? println buffers data and writes them all together. Equivalently a command to empty the print buffer would be useful.
user25004
  • 1,868
  • 1
  • 22
  • 47
6
votes
2 answers

Input/Output - Arithmetic Equation

I am brand new to Java, started two weeks ago and am having issues wrapping my mind around this issue. I have a problem in a class I am taking that has been brought up before. Converting kilograms to pounds and rounding to the second decimal place.…
Ph1shPhryd
  • 109
  • 7
6
votes
1 answer

How to store the console output to a variable in R

In R I would like to store a console command to a variable. I have already tried with the solutions proposed in the following link but without luck: In R, is it possible to redirect console output to a variable? Here you are the command I'm…
Gianluca78
  • 794
  • 1
  • 9
  • 24
6
votes
2 answers

logstash output to file and ignores codec

could please someone explain to me, why logstash keeps ignoring "codec => plain => format" setting, I am trying to set? Cfg file I am using: input { gelf { host => "[some ip]" port => 12201 …
user1946099
  • 63
  • 1
  • 1
  • 3