Re: bash: how to restore output to the term after exec>FILE?
From: Alan Connor (zzzzzz_at_xxx.yyy)
Date: 01/24/04
- Next message: Chris F.A. Johnson: "Re: bash: how to restore output to the term after exec>FILE?"
- Previous message: Ted Timar: "Welcome to comp.unix.shell [Frequent posting]"
- In reply to: nospam55: "bash: how to restore output to the term after exec>FILE?"
- Next in thread: joe_at_invalid.address: "Re: bash: how to restore output to the term after exec>FILE?"
- Reply: joe_at_invalid.address: "Re: bash: how to restore output to the term after exec>FILE?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 24 Jan 2004 09:28:27 GMT
On Sat, 24 Jan 2004 08:17:34 +0100, nospam55 <nospa@no.yahoo.no> wrote:
>
>
> Hi.
>
> In my .bashrc script I say
>
> exec > .bash.startup.log
>
> later I want output back to the terminal , how can I get this ? Maybe kind of
>
> exec &> /dev/tty
>
> ? Will this be reliable in generic bash scripts ?
>
>
> Thanks :-)
>
>
I don't think you need that first exec.
You are wanting to empty that log file, I assume, and this will do it:
:> .bash.startup.log
What happens when you use exec, is that you replace the shell with that
program, so I guess you'd have to kill it by finding its PID and
doing a kill -9 PID.
kill -9 $$
Might do it.
(You might want to put that command in a file called .bash_logout to
run as the shell exited rather than started up.)
AC
- Next message: Chris F.A. Johnson: "Re: bash: how to restore output to the term after exec>FILE?"
- Previous message: Ted Timar: "Welcome to comp.unix.shell [Frequent posting]"
- In reply to: nospam55: "bash: how to restore output to the term after exec>FILE?"
- Next in thread: joe_at_invalid.address: "Re: bash: how to restore output to the term after exec>FILE?"
- Reply: joe_at_invalid.address: "Re: bash: how to restore output to the term after exec>FILE?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|