saving the output of command line in a text file?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am using the following command line to analyse data:
unpackdcm -scr $in -targ $out
This command is printing on the screen status and description about the progress in the job. In order to save the status I did the following:
unpackdcm -scr $in -targ $out >stat.txt
But it did not work.
shell scripting io-redirection
add a comment |
I am using the following command line to analyse data:
unpackdcm -scr $in -targ $out
This command is printing on the screen status and description about the progress in the job. In order to save the status I did the following:
unpackdcm -scr $in -targ $out >stat.txt
But it did not work.
shell scripting io-redirection
1
Tryunpackdcm -scr $in -targ $out | tee stat.txt
.
– Ramesh
Oct 21 '14 at 20:48
add a comment |
I am using the following command line to analyse data:
unpackdcm -scr $in -targ $out
This command is printing on the screen status and description about the progress in the job. In order to save the status I did the following:
unpackdcm -scr $in -targ $out >stat.txt
But it did not work.
shell scripting io-redirection
I am using the following command line to analyse data:
unpackdcm -scr $in -targ $out
This command is printing on the screen status and description about the progress in the job. In order to save the status I did the following:
unpackdcm -scr $in -targ $out >stat.txt
But it did not work.
shell scripting io-redirection
shell scripting io-redirection
edited Mar 9 at 13:31
Rui F Ribeiro
41.9k1483142
41.9k1483142
asked Oct 21 '14 at 20:47
user88036
1
Tryunpackdcm -scr $in -targ $out | tee stat.txt
.
– Ramesh
Oct 21 '14 at 20:48
add a comment |
1
Tryunpackdcm -scr $in -targ $out | tee stat.txt
.
– Ramesh
Oct 21 '14 at 20:48
1
1
Try
unpackdcm -scr $in -targ $out | tee stat.txt
.– Ramesh
Oct 21 '14 at 20:48
Try
unpackdcm -scr $in -targ $out | tee stat.txt
.– Ramesh
Oct 21 '14 at 20:48
add a comment |
2 Answers
2
active
oldest
votes
The >
-sign represents an I/O-Redirection. With >stat.txt
you redirect the standard output (stdout) of the application to the file stat.txt
. It is redirected, so you will not see any output in the shell.
If you want the output in the current shell AND the file pipe the output into tee
:
your_command | tee stat.txt
Or..
your_command | tee -a stat.txt
..to append to the file.
Your application may also produce some errors. They mostly occure in the standard error (see standard streams). To redirect that stream use the folloing syntax:
your_command 2>error.log
add a comment |
It's possible that the output is being sent to stderr
which is not captured by the >
operator which only captures stdout
.
Instead, if you are using the bash shell, try routing stderr
to stdout
and into a file using the &>
operator.
For example:
unpackdcm -scr $in -targ $out &>stat.txt
To redirect only stderr
, use this:
unpackdcm -scr $in -targ $out 2>stat.txt
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f163466%2fsaving-the-output-of-command-line-in-a-text-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The >
-sign represents an I/O-Redirection. With >stat.txt
you redirect the standard output (stdout) of the application to the file stat.txt
. It is redirected, so you will not see any output in the shell.
If you want the output in the current shell AND the file pipe the output into tee
:
your_command | tee stat.txt
Or..
your_command | tee -a stat.txt
..to append to the file.
Your application may also produce some errors. They mostly occure in the standard error (see standard streams). To redirect that stream use the folloing syntax:
your_command 2>error.log
add a comment |
The >
-sign represents an I/O-Redirection. With >stat.txt
you redirect the standard output (stdout) of the application to the file stat.txt
. It is redirected, so you will not see any output in the shell.
If you want the output in the current shell AND the file pipe the output into tee
:
your_command | tee stat.txt
Or..
your_command | tee -a stat.txt
..to append to the file.
Your application may also produce some errors. They mostly occure in the standard error (see standard streams). To redirect that stream use the folloing syntax:
your_command 2>error.log
add a comment |
The >
-sign represents an I/O-Redirection. With >stat.txt
you redirect the standard output (stdout) of the application to the file stat.txt
. It is redirected, so you will not see any output in the shell.
If you want the output in the current shell AND the file pipe the output into tee
:
your_command | tee stat.txt
Or..
your_command | tee -a stat.txt
..to append to the file.
Your application may also produce some errors. They mostly occure in the standard error (see standard streams). To redirect that stream use the folloing syntax:
your_command 2>error.log
The >
-sign represents an I/O-Redirection. With >stat.txt
you redirect the standard output (stdout) of the application to the file stat.txt
. It is redirected, so you will not see any output in the shell.
If you want the output in the current shell AND the file pipe the output into tee
:
your_command | tee stat.txt
Or..
your_command | tee -a stat.txt
..to append to the file.
Your application may also produce some errors. They mostly occure in the standard error (see standard streams). To redirect that stream use the folloing syntax:
your_command 2>error.log
answered Oct 21 '14 at 20:56
chaoschaos
36.1k977120
36.1k977120
add a comment |
add a comment |
It's possible that the output is being sent to stderr
which is not captured by the >
operator which only captures stdout
.
Instead, if you are using the bash shell, try routing stderr
to stdout
and into a file using the &>
operator.
For example:
unpackdcm -scr $in -targ $out &>stat.txt
To redirect only stderr
, use this:
unpackdcm -scr $in -targ $out 2>stat.txt
add a comment |
It's possible that the output is being sent to stderr
which is not captured by the >
operator which only captures stdout
.
Instead, if you are using the bash shell, try routing stderr
to stdout
and into a file using the &>
operator.
For example:
unpackdcm -scr $in -targ $out &>stat.txt
To redirect only stderr
, use this:
unpackdcm -scr $in -targ $out 2>stat.txt
add a comment |
It's possible that the output is being sent to stderr
which is not captured by the >
operator which only captures stdout
.
Instead, if you are using the bash shell, try routing stderr
to stdout
and into a file using the &>
operator.
For example:
unpackdcm -scr $in -targ $out &>stat.txt
To redirect only stderr
, use this:
unpackdcm -scr $in -targ $out 2>stat.txt
It's possible that the output is being sent to stderr
which is not captured by the >
operator which only captures stdout
.
Instead, if you are using the bash shell, try routing stderr
to stdout
and into a file using the &>
operator.
For example:
unpackdcm -scr $in -targ $out &>stat.txt
To redirect only stderr
, use this:
unpackdcm -scr $in -targ $out 2>stat.txt
edited Oct 21 '14 at 21:01
terdon♦
133k33268449
133k33268449
answered Oct 21 '14 at 20:55
jonescbjonescb
1,60311220
1,60311220
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f163466%2fsaving-the-output-of-command-line-in-a-text-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Try
unpackdcm -scr $in -targ $out | tee stat.txt
.– Ramesh
Oct 21 '14 at 20:48