help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] shell redirection


From: John McKown
Subject: Re: [Help-bash] shell redirection
Date: Wed, 19 Oct 2016 20:32:34 -0500

On Wed, Oct 19, 2016 at 12:28 PM, Christof Warlich <address@hidden>
wrote:

> Hi,
> looks like I still haven’t fully gasped shell redirection:
> I want my script(s) to print stderr to the terminal, while both stdout
> _/and/_ stderr should go to a logfile. I thought that this is an easy task,
> but so far, I failed miserably.
> Any ideas how this could be done, ideally without using any temporary
> files or named pipes?
> Many thanks,
> Chris
>
>
​I've read all the replies. And tried some really strange things myself.
The closest that I can come to what you want (and it is not all that close)
is to use the "script" program to run your program.

script -c 'somecmd p1 parm2 --option' logfile.txt

Both stdout & stderr come to the terminal & get written to logfile.txt​ .
There is no way, that I know of, to put stdout into "logfile.txt" but
suppress it from the terminal.


-- 
Heisenberg may have been here.

Unicode: http://xkcd.com/1726/

Maranatha! <><
John McKown


reply via email to

[Prev in Thread] Current Thread [Next in Thread]