LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Command line to get output on a file (https://www.linuxquestions.org/questions/programming-9/command-line-to-get-output-on-a-file-336689/)

satimis 06-24-2005 03:41 AM

Command line to get output on a file
 
Hi folks,

On Konsole window I started Gnomemeeting with;

$ LC_ALL=C gnomemeeting -d4

and then connected it to a remote self-testing site on Gnomemeeting device. All output were printed on the Konsole window.

I tried with following command line in anticipation to get the output to a file without success;

$ LC_ALL=C gnomemeeting -d4 > /path/to/record.txt.

Only an empty file was created. Please advise what will be the correct command line to be used.

TIA

B.R.
satimis

keefaz 06-24-2005 04:00 AM

Try :

LC_ALL=C gnomemeeting -d4 > /path/to/record.txt 2>&1

satimis 06-24-2005 04:14 AM

Hi keefaz,

Tks for your advice.

Quote:

LC_ALL=C gnomemeeting -d4 > /path/to/record.txt 2>&1
It worked for me.

Please advice what is the function of '2>$1'

Besides can the printout also be displayed on Konsole simultaneously. If YES, what shall I add. TIA

B.R.
satimis

keefaz 06-24-2005 05:04 AM

2 : standard error output
1 : standard output

2>&1 : output both standard and error (bash shell syntax)

Quote:

Besides can the printout also be displayed on Konsole simultaneously
You could use tee command
Code:

LC_ALL=C gnomemeeting -d4  2>&1 | tee /path/to/record.txt

satimis 06-24-2005 06:04 AM

Hi keefaz,

Quote:

Code:

LC_ALL=C gnomemeeting -d4  2>&1 | tee /path/to/record.txt

It works. Tks

B.R.
satimis


All times are GMT -5. The time now is 04:34 AM.