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
4
votes
1 answer

Redirect stio and still printing in the terminal

Thanks to this great answer from @Przemyslaw Szufel, we can easily redirect stdio output into a file providing its path. I wanted to know if it is possible to both redirect stio output to a file and still continue print it in the terminal. That is…
JKHA
  • 1,800
  • 11
  • 28
4
votes
1 answer

How to run command in background and also capture the output

In the middle of the script, I have a command that exposes the local port with ssh -R 80:localhost:8080 localhost.run I need to execute this command in the background, parse the output and save it into a variable. The output returns: Welcome to…
user16965639
  • 176
  • 11
4
votes
1 answer

Different output for equivalent code between Matlab and Julia

I have a working Matlab algorithm for the evolution of a pulse via solving the 1D wave equation. I know the code works and I can see the pulse traveling to the sides and bouncing off the walls, when plotting; but when I translate the corresponding…
Alej
  • 51
  • 2
4
votes
1 answer

Ansible ad-hoc output: How to split every node result with new line?

In Ubuntu 20.04 and Ansible version 2.9, using Ansible ad-hoc command like: ansible all -m shell -a "df -h" will print like below app2 | CHANGED | rc=0 >> Filesystem Size Used Avail Use% Mounted on devtmpfs 215M 0 215M …
4
votes
1 answer

Knitting/Rendering R Markdown Output: Can I prevent code from showing in PDF output but allow code folding in HTML output?

Showing the code in PDF can be long and distracting to some readers or clients, but I would leave it as an option in the HTML version if they want to reproduce it or verify what I've done. Depending on whom I work with, I may share one or the other…
LC-datascientist
  • 1,960
  • 1
  • 18
  • 32
4
votes
1 answer

How to print output on the same line as input?

How can I print on the same line as input? This is my code #include int main() { int number; printf("Enter number: "); scanf("%d", &number); printf("You entered: %d",number); return 0; …
AhmetEnesKCC
  • 69
  • 2
  • 8
4
votes
1 answer

Capture coloured console output from multiple sources

I wrote a console application that is able to execute multiple commands on the command line in parallel. Primarily I did this out of interest and because the build processes of the software projects I am working on make excessive use of the command…
4
votes
2 answers

Batch Script is exporting weird characters

I am having an issue with a script. I will post it. It runs fine till it gets to this line: wmic diskdrive list full | findstr /B "Size=" >> %cd%ProductCodes\%Serial%\PCINFO.txt This is what it sends to the file... 楓敺ㄽ㐲ㄱ㈱㤴㈹ര਍楓敺㈽㘵㔰㤲㘶〴ര਍ Any help…
doheth
  • 87
  • 9
4
votes
2 answers

Custom font color for Powershell output

Let's take the powershell command Write-Host "red text" -Fore red this displays "red text" in a foreground of red. But, you want the text to be displayed in a slightly lighter font color, light red. Is there a way to do this and get any foreground…
Kudos
  • 346
  • 3
  • 10
4
votes
1 answer

How to ouput a date punctually in another language in R

I usually set my working environment in English although it is not my mother tongue, because most dates I use in input are this way. However, I sometimes to output a date in a long format in another language, usually French. library(lubridate)…
Anthony Martin
  • 767
  • 1
  • 9
  • 28
4
votes
3 answers

Python Return Command In Recursion Function

While learning Python and browsing the internet I stumble upon a piece of code in w3schools.com. I tried to run it using their built-in site Python IDLE and using my own Python 3.9.0 Shell. What I got is two different outputs. I want to know which…
Hai
  • 61
  • 6
4
votes
2 answers

Output window shows thrown exceptions

So I am working on exception handling and I used a try-catch to solve an issue with converting strings to integers. The project runs fine, but if I look in the output window, multiple messages like this one show up: Exception thrown at…
WolfyDoo
  • 143
  • 8
4
votes
3 answers

Perl: How to check the max width of word present in columns of array after reading from file?

I am reading from a file and again writing to another file. So when writing due to some big words alignment of the subsequent column gets distorted. I want to align all columns regardless of their length. I got one related question here. But the…
Alex
  • 59
  • 4
4
votes
1 answer

What is causing my program to only print parentheses?

I have written a Haskell program in which I want to implement a carry-save adder. I have defined type Nibble = (Bool, Bool, Bool, Bool) and type Byte = (Nibble, Nibble). The function of the carry-save adder is carrySaveAdder :: Byte -> Byte -> Byte…
Liv M
  • 43
  • 6
4
votes
0 answers

How to get python 3 output to display when ran under supervisor?

I am trying to display the output of my Python 3 script (Ubuntu 18.04) under supervisord (4.2.0). I tried all the solutions listed either in SE (re: flagging for duplicates), or on various forums - among others the two most popular: forcing python…
WoJ
  • 27,165
  • 48
  • 180
  • 345