[comp.unix.wizards] System V Release 4.0 Developers

carroll@s.cs.uiuc.edu (10/10/88)

/* Written  3:46 pm  Oct  7, 1988 by gwyn@smoke.ARPA in s.cs.uiuc.edu:comp.unix.wizards */
/* ---------- "Re: System V Release 4.0 Developers" ---------- */
In article <2691@ihwpt.ATT.COM> dem@ihwpt.ATT.COM (David E. Martin) writes:
>My big question for System V 4.0 is: Does it have BSD style job control?

Certainly it would for the "BSD new tty" line discipline and csh.
If its /bin/sh doesn't support job control you could use the BRL version.
/* End of text from s.cs.uiuc.edu:comp.unix.wizards */

I'm sorry, I missed something here. My understanding is that it is the OS
that supports job control (or not), not the shell. While sh doesn't deal
with stopped/background jobs, ksh does, and I thought that ksh would be
standard in SysVR4. Is the BRL shell public domain, or obtainable for a
nominal fee? Or do you have to have sh source first?

Alan M. Carroll          "How many danger signs did you ignore?
carroll@s.cs.uiuc.edu     How many times had you heard it all before?" - AP&EW
CS Grad / U of Ill @ Urbana    ...{ucbvax,pur-ee,convex}!s.cs.uiuc.edu!carroll

ekrell@hector.UUCP (Eduardo Krell) (10/11/88)

In article <216100004@s.cs.uiuc.edu> carroll@s.cs.uiuc.edu writes:

>I'm sorry, I missed something here. My understanding is that it is the OS
>that supports job control (or not), not the shell.

it's both. That is, job control is needed in the kernel and the shell
has to know what to do when you type ^Z or fg or bg, etc. ksh supports
job control ONLY WHEN the underlying operating system does. If you take
a vanilla bourne shell and compile it on a system with job control,
you won't get a shell with job control support.
    
Eduardo Krell                   AT&T Bell Laboratories, Murray Hill, NJ

UUCP: {att,decvax,ucbvax}!ulysses!ekrell  Internet: ekrell@ulysses.att.com

gwyn@smoke.ARPA (Doug Gwyn ) (10/12/88)

In article <216100004@s.cs.uiuc.edu> carroll@s.cs.uiuc.edu writes:
>I'm sorry, I missed something here. My understanding is that it is the OS
>that supports job control (or not), not the shell.

Actually, it's both.

>While sh doesn't deal with stopped/background jobs, ksh does,

On BSD systems.  Whether or not that is provided for SVR4.0 is a mystery.

>Is the BRL shell public domain, or obtainable for a
>nominal fee? Or do you have to have sh source first?

It's available free to anyone with a SVR2 or later source license.

ron@ron.rutgers.edu (Ron Natalie) (10/12/88)

BSD job control relies heavily on the behaviour of process groups
in the kernel.  What this provides for is the ability to selectively
change what processes are allowed to read and write from the terminal.
It also adds a set of signals that allow processes to be suspended,
either because the user typed the suspend character, or the user attempted
to read or write the terminal when not authorized.  The kernel doesn't
know foreground from background.  All it knows is whether these signals
are caught/ingored or whatever and what the process group on the terminal
and each process are.

The shells are the book keepers of this whole mess.  They essentially do
ioctls to map the terminals process group to that of the foreground processes.
They catch information on process state change from the kernel by the
wait system call and presents that to the user.

If the shell doesn't know about job control, some not so fun things happen
when processes suspend.  Best demonstration, start up /bin/sh and then run
a program like talk and type ^Z.  The shell doesn't know about job control
so it just sits there and waits for the job to exit, which it isn't going
to do because it's suspended.  The csh, and the spiffier /bin/sh varients
actually catch the suspend info and do the process management.

The BRL Bourne Shell is a System VR2 shell.  Starting with VR2 gives us
the shell functions (the /bin/sh flavor of aliases) as well as numerous
bug fixes over the one provided with 4.2 BSD.  One major advantage is
that with VR2 the shell was written in C :-).   After typing ^Z at talk
one too many times, I put job control in to the Bourne shell.  This
change is twisted through so many modules that it is inseperable.  Hence,
you will need a System V source license to get this changes.  Right
after I did this, we got a hot copy of KSH, but AT&T said they had no
plans to make it officially available.  To try to convert a bunch of
tcsh users I added a command editing module to the shell.  This is
a surrogate readc() routine and hence can be sent along as is (although
you'd need sources to compile it in with the rest of the shell).
Doug added some additional features like ~user substitution, shell
TIMEOUT, and ignoreof facility.

-Ron

ekrell@hector.UUCP (Eduardo Krell) (10/12/88)

In article <8673@smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:

(about job control support in /bin/sh)

>Whether or not that is provided for SVR4.0 is a mystery.

Not anymore. It is supported. All you have to do to turn it on is to
define the suspend character.
    
Eduardo Krell                   AT&T Bell Laboratories, Murray Hill, NJ

UUCP: {att,decvax,ucbvax}!ulysses!ekrell  Internet: ekrell@ulysses.att.com

ron@ron.rutgers.edu (Ron Natalie) (10/12/88)

Rutgers is trying to negotiate a Beta agreement for VR4.0.  It it happens, my shell is one of the
first things I port to any environment.  Stay tuned...

-Ron

carroll@s.cs.uiuc.edu (10/13/88)

/* Written  2:36 pm  Oct 11, 1988 by gwyn@smoke.ARPA in s.cs.uiuc.edu:comp.unix.wizards */
In article <216100004@s.cs.uiuc.edu> carroll@s.cs.uiuc.edu writes:
>While sh doesn't deal with stopped/background jobs, ksh does,

On BSD systems.  Whether or not that is provided for SVR4.0 is a mystery.
/* End of text from s.cs.uiuc.edu:comp.unix.wizards */

Wow. It never occurred to me that job control wouldn't be enabled in ksh
for SysVR4. We ported it to a number of BSD systems, and the only effort
enabling job control took was switching a flag in the makefile. My fiance
(the undergraduate) is writing a shell, and she got job control to work
(mostly-the interface is marginal, but you can do it). Do you really
believe that AT&T and Sun are *that* stupid? Wait, don't answer that...
The gist here is, if ksh for SysVR4 doesn't have job control, that would
mean that someone decided to *not* have it, as opposed to it not being
feasible.

Alan M. Carroll          "How many danger signs did you ignore?
carroll@s.cs.uiuc.edu     How many times had you heard it all before?" - AP&EW
CS Grad / U of Ill @ Urbana    ...{ucbvax,pur-ee,convex}!s.cs.uiuc.edu!carroll

ekrell@hector.UUCP (Eduardo Krell) (10/14/88)

In article <216100005@s.cs.uiuc.edu> carroll@s.cs.uiuc.edu writes:

>Wow. It never occurred to me that job control wouldn't be enabled in ksh
>for SysVR4.

This is simply not true. I witnessed how Dave Korn ported ksh over to
SVR4 and had it running with job control in a matter of minutes.
    
Eduardo Krell                   AT&T Bell Laboratories, Murray Hill, NJ

UUCP: {att,decvax,ucbvax}!ulysses!ekrell  Internet: ekrell@ulysses.att.com