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
5
votes
2 answers

Unable to redirect output of "java" command to text file

I am trying the following in my cmd prompt: java>temp.txt temp.txt is getting created with no content in it. "java" command output is displayed in console itself without getting redirecting to temp.txt But if i do the following: dir> temp.txt output…
Akshaj Kumar
  • 61
  • 1
  • 4
5
votes
2 answers

Store output of ForEach into array in powershell

$data = @("server1","server2","server3") foreach ($server in $data) { $results = (Test-Connection $server -count 1 | Measure-Object -Property ResponseTime -Average).Average } I'm trying to figure out how to take the output of a ForEach and…
Aaron
  • 3,135
  • 20
  • 51
  • 78
5
votes
2 answers

Why is the order of output of a C program different when its stdout is redirected to a file?

Here is my program. #include #include int main() { printf("Hello\n"); system("uname"); return 0; } Here is the output. $ gcc foo.c $ ./a.out Hello Linux However, if I redirect the output of the program to a file,…
Lone Learner
  • 18,088
  • 20
  • 102
  • 200
5
votes
1 answer

using nohup -> output to file and console

iam using nohup in my project. Is there a possibility get the Output of the program to the console and to the file at the same time while using nohup? With "tee"i had no sucess: nohup ./programm 2>&1 | tee Output.txt thanks for help
user3707049
  • 65
  • 1
  • 1
  • 11
5
votes
0 answers

sink() within source() in R not working properly

I have the following code: source("file.R") and file.R includes: tab<-table(variable) sink("variable.txt") tab sink() However, the variable.txt file is empty. Any idea why ? I am using RStudio Version 0.99.902 and R version 3.3.1, on a Mac OS X El…
Bernd
  • 91
  • 7
5
votes
1 answer

Force output in QtCreator for console app

When I am using Qt Creator to make a widget app, the text output is redirected to the Qt Creator built in console (For example from QDebug function). When I work with a console app however, the text output is redirected to a separate terminal…
Łukasz Przeniosło
  • 2,725
  • 5
  • 38
  • 74
5
votes
1 answer

How can I print the Truth value of a variable?

In Python, variables have truthy values based on their content. For example: >>> def a(x): ... if x: ... print (True) ... >>> a('') >>> a(0) >>> a('a') True >>> >>> a([]) >>> a([1]) True >>> a([None]) True >>> a([0]) True I also know…
Tim
  • 2,563
  • 1
  • 23
  • 31
5
votes
3 answers

System.out.println to text file

I was searching a way to get System.out.println texts and save them on a .txt file, for example: System.out.println("Java vendor: " + System.getProperty("java.vendor")); System.out.println("Operating System architecture: " +…
Sapus Boh
  • 105
  • 1
  • 1
  • 8
5
votes
3 answers

How to check if output buffering is enabled in Python

There are a lot of ways to set output buffering off in Python: Disable output buffering What makes me curious is how do I know that output buffering is really really already off? What is the best and simple way to check it?
Aminah Nuraini
  • 18,120
  • 8
  • 90
  • 108
5
votes
2 answers

Access elements in summary() in R

I would like to access some elements of an Anova summary in R. I've been trying things like in this question Access or parse elements in summary() in R. When I convert the summary to a string it shows something like this: str(summ) List of 1 $…
user3801533
  • 321
  • 1
  • 6
  • 15
5
votes
7 answers

Explanation for this function's output

I am doing review questions which ask me "What is the output of the following," and I am having some trouble understanding something about this function: int a = 1, b = 1, c = -1; c = --a && b++; printf("%d %d %d", a, b, c); The output is 010. My…
Bobbis
  • 137
  • 1
  • 7
5
votes
1 answer

How do I customize the .exe filename for Microsoft cmdline compiler, cl?

The only two options that I was able to find from googling are /OUT and /Fe, but neither works for me: Using /Fe shows no error but no output file found in the current dir either: C:\hands_on\C>cl /Fe:test.exe main.c Microsoft (R) C/C++ Optimizing…
Ltf4an
  • 787
  • 5
  • 18
5
votes
1 answer

Xcode Playground: Trying to disable output for specific lines of code

I have a very long loop that takes forever in playground because of the constant output. Is there a way to disable output for certain lines of code? I still want the whole thing to run, I just don't want to wait forever to see the result. FYI - I…
5
votes
1 answer

phpunit - How to format output

I want to format PHPUnit output like this: 1/15. ATestCaseTest ... passed (3/3), time: 0ms 1/59. DISABLED_test1 ... skipped , time: 0ms 2/59. test2 ... passed , time: 1497ms 3/59. test3 ... passed , time: 593ms 2/15. AnotherTestCaseTest ...…
NickSoft
  • 3,215
  • 5
  • 27
  • 48
5
votes
2 answers

Input String and int in the same line

How can I input a String and an int in the same line? Then I want to proceed it to get the largest number from int that I already input: Here is the code I have written so far. import java.util.Scanner; public class NamaNilaiMaksimum { public…
nanang
  • 63
  • 1
  • 2
  • 9