Re: Howto redirect output from a terminal

2003-01-29 Thread Bob Proulx
Michael Kahle wrote:
 a terminal in X.  As it was running I could see in the terminal window all
 the status output from the program.  Good.  This backup job took a long time
 to complete and so I went home while the backup was still running.  When at
 home I ssh'd into the box to see if the dump process was still running, it
 was.  Then I got to thinking, how can I see the output of this program in my
 current ssh session?  Is there a program that exists to allow me to redirect
 the output of a program running in a terminal to another terminal?  I hope I
 am explaining this clearly.

With some forethought.  But not if you just ran it cold.

1. You can redirect the output to a file.  Then look at the output of
   the file remotely.

 command 21 | tee logfile

   Then on the remote computer just look at the log file.

 tail -f logfile
   or
 less logfile

2. You can use the 'screen' program to run your command.  Screen is a
   really nice utility that allows you to run a command one place,
   then pick it up again someplace else.  Here is a simple example.

 screen
 ...then run commands...

   On your remote login grab this screen window and see what is
   happening.

 screen -d -r
 ...then see your commands from before...

apt-get install screen

3. Use VNC which is a fully graphical version of the above.  Which is
   really describing it too simply but good for now.

 apt-get install xvncviewer vncserver

You will need to read the manuals to really know how to use the
above.  But perhaps those pointers will be useful.

Bob



msg27218/pgp0.pgp
Description: PGP signature


Re: Howto redirect output from a terminal

2003-01-29 Thread Matthew Weier O'Phinney
-- Michael Kahle [EMAIL PROTECTED] wrote
(on Wednesday, 29 January 2003, 10:48 AM -0600):
 I am not sure how to ask for what I want here.  But, here goes.  I was using
 dump to make a backup of a directory on my computer.  This was started from
 a terminal in X.  As it was running I could see in the terminal window all
 the status output from the program.  Good.  This backup job took a long time
 to complete and so I went home while the backup was still running.  When at
 home I ssh'd into the box to see if the dump process was still running, it
 was.  Then I got to thinking, how can I see the output of this program in my
 current ssh session?  Is there a program that exists to allow me to redirect
 the output of a program running in a terminal to another terminal?  I hope I
 am explaining this clearly.

redirect output to a file:
dump  somefile

and then you can look at 'somefile' to see what's been happening, or use
'tail -f somefile' to see it happening in 'realtime'.

-- 
Matthew Weier O'Phinney
[EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Howto redirect output from a terminal

2003-01-29 Thread Jason Pepas
On Wednesday 29 January 2003 10:48 am, Michael Kahle wrote:
 I am not sure how to ask for what I want here.  But, here goes.  I was
 using dump to make a backup of a directory on my computer.  This was
 started from a terminal in X.  As it was running I could see in the
 terminal window all the status output from the program.  Good.  This backup
 job took a long time to complete and so I went home while the backup was
 still running.  When at home I ssh'd into the box to see if the dump
 process was still running, it was.  Then I got to thinking, how can I see
 the output of this program in my current ssh session?  Is there a program
 that exists to allow me to redirect the output of a program running in a
 terminal to another terminal?  I hope I am explaining this clearly.

 Thanks,

 Michael

two options.

the option I think you want is screen.

while in an xterm, start screen.  Now start executing commands like normal.  
When you are ready to log out, type CTRL+A, CTRL+D to detach the screen 
session.

Later, when you ssh back into your machine, type screen -r to re-attach that 
session, just as it was.

the second option is to use script.  If you just want to capture the output of 
a program, start script, execute stuff, and then type exit to stop script.  
All screen ouput was logged to a file in the current directory.

-jason pepas



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Howto redirect output from a terminal

2003-01-29 Thread sean finney
heya,

i'd suggest either nohup or screen.  the former is dirt simple but
not very featureful, and the second is the opposite.


hth
sean

On Wed, Jan 29, 2003 at 10:48:04AM -0600, Michael Kahle wrote:
 I am not sure how to ask for what I want here.  But, here goes.  I was using
 dump to make a backup of a directory on my computer.  This was started from
 a terminal in X.  As it was running I could see in the terminal window all
 the status output from the program.  Good.  This backup job took a long time
 to complete and so I went home while the backup was still running.  When at
 home I ssh'd into the box to see if the dump process was still running, it
 was.  Then I got to thinking, how can I see the output of this program in my
 current ssh session?  Is there a program that exists to allow me to redirect
 the output of a program running in a terminal to another terminal?  I hope I
 am explaining this clearly.
 
 Thanks,
 
 Michael
 
 
 -- 
 To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
 with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
 



msg27246/pgp0.pgp
Description: PGP signature


Re: Howto redirect output from a terminal

2003-01-29 Thread Michael Heironimus
On Wed, Jan 29, 2003 at 10:48:04AM -0600, Michael Kahle wrote:
 to complete and so I went home while the backup was still running.  When at
 home I ssh'd into the box to see if the dump process was still running, it
 was.  Then I got to thinking, how can I see the output of this program in my
 current ssh session?  Is there a program that exists to allow me to redirect
 the output of a program running in a terminal to another terminal?  I hope I
 am explaining this clearly.

The usual way that people do this is to either run things in screen and
detach/attach sessions, or to redirect output to a file and run tail -f
on it. I prefer the second, since it leaves me with a logfile I can
check later.

-- 
Michael Heironimus


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




RE: Howto redirect output from a terminal

2003-01-29 Thread Michael Kahle

 From: sean finney wrote:
 heya,
 
 i'd suggest either nohup or screen.  the former is dirt 
 simple but not very featureful, and the second is the opposite.

OK, I just installed screen, very cool program, but not what I am looking
for.  I need to be able to run a program in a window.  Then when later
logging into this machine remotely be able to view the output of a program
that is running in the X terminal window that I started earlier when I was
at the console.  Does that make more sense?  I read the man page for nohup,
this is not going to do what I am asking.

Thanks!

Michael


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Howto redirect output from a terminal

2003-01-29 Thread Bob Paige
Michael Kahle wrote:


I am not sure how to ask for what I want here.  But, here goes.  I was using
dump to make a backup of a directory on my computer.  This was started from
a terminal in X.  As it was running I could see in the terminal window all
the status output from the program.  Good.  This backup job took a long time
to complete and so I went home while the backup was still running.  When at
home I ssh'd into the box to see if the dump process was still running, it
was.  Then I got to thinking, how can I see the output of this program in my
current ssh session?  Is there a program that exists to allow me to redirect
the output of a program running in a terminal to another terminal?  I hope I
am explaining this clearly.
 

I use 'screen' for this alot, but you have to start it ahead of time.

Screen acts as its own virtual terminal. You start screen from any 
terminal and it leaves you at a terminal prompt. Now you can do whatever 
you want (i.e. start your backup). From another terminal (ssh'd in or 
otherwise) you can cause that screen virtual terminal to be displayed on 
your new terminal and not the original one. The screen manpage describes 
all the keystrokes and options required for this.

Another great use of screen is to open multiple virtual terminals in a 
single terminal window. Once I ssh into a machine, I usually start a 
screen session so I can have multiple terminal windows to work with. 
That way I don't have to start multiple terminals on my machine and ssh 
into the target machine individually.

- Bobman




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Howto redirect output from a terminal

2003-01-29 Thread jaycee . spamtrap
On Wed, Jan 29, 2003 at 10:48:04AM -0600, Michael Kahle wrote:
[snip]
 current ssh session?  Is there a program that exists to allow me to
 redirect
 the output of a program running in a terminal to another terminal?
 I hope I
 am explaining this clearly.

Michael -

Take a look at the 'screen' package.

Once you've installed it, the important commands are
Ctrl-A to create a new screen
Ctrl-Space to cycle all available screen
Ctrl-d to detach a session

So here's how you do it:

Start screen
run the command you want to monitor
Ctrl-d to detach.
log off
.
.
log on to the new terminal you want to monitor things from
run 'screen -r'

.. and there you go, looking at what you just started running.

NB Using Ctrl-A to start 2,3,4,5 or more screens is really, _really_
useful! Take a look at it.

-- jc
I'm big and he's clever


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




RE: Howto redirect output from a terminal

2003-01-29 Thread Michael Kahle
 Screen acts as its own virtual terminal. You start screen from any 
 terminal and it leaves you at a terminal prompt. Now you can 
 do whatever 
 you want (i.e. start your backup). From another terminal (ssh'd in or 
 otherwise) you can cause that screen virtual terminal to be 
 displayed on 
 your new terminal and not the original one. The screen 
 manpage describes 
 all the keystrokes and options required for this.

Oh!  I see how this works now!  Slick.  Sorry to Sean Finney, I see now what
he was trying to explain.  Man this is great.  Thanks so much!!!

Michael


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Howto redirect output from a terminal

2003-01-29 Thread Steve Mayer
Michael,

  If you start screen, then start your application, you can detach the
  screen session while leaving your application running and then later,
  reattach to the same screen session from home.  You're app will still
  be running and you'll be able to see the output.  Another solution
  might be to use the script utility that captures all output to a file:

  see 'man script'

  You can then tail -f the file that script is sending its' output to.

Steve

On Wed, Jan 29, 2003 at 02:18:11PM -0600, Michael Kahle wrote:
 
  From: sean finney wrote:
  heya,
  
  i'd suggest either nohup or screen.  the former is dirt 
  simple but not very featureful, and the second is the opposite.
 
 OK, I just installed screen, very cool program, but not what I am looking
 for.  I need to be able to run a program in a window.  Then when later
 logging into this machine remotely be able to view the output of a program
 that is running in the X terminal window that I started earlier when I was
 at the console.  Does that make more sense?  I read the man page for nohup,
 this is not going to do what I am asking.
 
 Thanks!
 
 Michael
 
 
 -- 
 To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
 with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
 
=
Steve Mayer Oracle Corporation
Senior Member of Technical Staff1211 SW 5th Ave.
Portland Development Center Suite 900
[EMAIL PROTECTED]Portland, OR 97204 
Phone:  503-525-3127
=


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Howto redirect output from a terminal

2003-01-29 Thread Matthew Weier O'Phinney
-- Michael Kahle [EMAIL PROTECTED] wrote
(on Wednesday, 29 January 2003, 02:18 PM -0600):
 
  From: sean finney wrote:
  heya,
  
  i'd suggest either nohup or screen.  the former is dirt 
  simple but not very featureful, and the second is the opposite.
 
 OK, I just installed screen, very cool program, but not what I am looking
 for.  I need to be able to run a program in a window.  Then when later
 logging into this machine remotely be able to view the output of a program
 that is running in the X terminal window that I started earlier when I was
 at the console.  Does that make more sense?  I read the man page for nohup,
 this is not going to do what I am asking.

You got a few other options, from the responses -- redirect output to a
file and run 'tail -f' on it from whatever terminal/window you want.

With screen, if you want to login and use a running screen, you simply
do a 'screen -D -r' -- this detaches it from the window that was using
it and attaches it to the terminal from which you're calling it. You can
also attach to the same screen without detaching -- 'screen -ls'
tells you the current screen sessions, and you simply attach to the one
you need.

(I'm writing this from a screen session -- it's nice because it can
perpetuate between X sessions, as well -- so if I decide to logout so
somebody else can use the computer, I simply detach my screen, logout,
and when I log back in, I can re-attach to where I left my work.)

-- 
Matthew Weier O'Phinney
[EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Howto redirect output from a terminal

2003-01-29 Thread Andy

(This post is coming from a former athlete)

Sometimes watching (reading) how you all do your magic on this list,
I think of the things Wayne Gretzky and Michael Jordan used to do.

Keep it up debian-users.  Good stuff.  We are all watching you!!!

Andy
(watching, reading, and learning Debian)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]