[comp.sys.hp] A Free Terminal

ferneau@hpindda.HP.COM (Mark Ferneau) (02/01/90)

> I have a primitive question about launching background jobs (or
> processes) without tying up an end-user terminal. 

Sounds simple enough--and remember no question is "primitive".
If you look at the man page(s) for the shell
you are using (sh, csh, or ksh), they each describe how to execute
commands in the background.  See "Commands" under sh(1), "Jobs" under csh(1)
or ksh(1).

Basically for a command named "boffo", you just type (at the beautiful unix
shell prompt):

	 boffo &
	       ^ notice that nifty symbol.  This tells the shell to execute
"boffo" in the background.  Of course if boffo wants to use stdin or stdout
it won't get too far--but that brings us to the next question...

> As a bonus question, I would even be more grateful if you could tell
> me how I could redirect the output of the rje program to a file
> instead of the default output which is the terminal screen.

O.k.  if I answer this one, what prize do I get?? :-)
Once again, if you look at the aforementioned man pages under the
section entitled "Input/Output" it will describe all of the options for
what you describe.  To continue on the above example...  To save the
output from "boffo" to a file named "zowee" AND run it in the background,
the following should suffice:
	boffo > zowee &

How's that?

walter@hpsad.HP.COM (Walter Coole) (02/01/90)

I think what you want to do is launch a background process.  The standard way
to do this in unix is:

      command-and-arguments &

many commands can have their standard inputs and outputs redirected to/from
files:

    command-and-arguments <file-for-input >file-for-output &

For some programs that need a bunch of interaction to start them up job control
is useful; at any point one can type the SUSPEND character, which gives one
the shell prompt, one can then type:
    
    bg

to allow the process to continue in background.  Not all versions of unix
support full job control.  My recollection is that all versions of HPUX for
800 series do, and 6.0 on for 300 series do, but that HPUX only allows job
control for users whose shell is csh.

    "Advanced Programmer's Guide to UNIX" by Thomas, Rogers and Yates has
a clear explanation of background processes, as well as other basic unix 
concepts.

--Not an Official Response--

jws@hpcljws.HP.COM (John Stafford) (02/02/90)

But beware, it is well and good to put things in the background as these
folks have indicated, but if you logoff the "free terminal" and the
background job isn't done, it may be "terminated with prejudice", see
the nohup(1) command for ways around that.

rdg@hpfcmgw.HP.COM (Rob Gardner) (02/07/90)

> to allow the process to continue in background.  Not all versions of unix
> support full job control.  My recollection is that all versions of HPUX for
> 800 series do, and 6.0 on for 300 series do, but that HPUX only allows job
> control for users whose shell is csh.

Job control is available on the 300 starting withe the 6.5 release,
and works in csh and ksh.

Rob