[comp.sources.wanted] C shell for System V

lhb@duke.cs.duke.edu (Pete Boyd) (07/13/87)

We are planning to e AT&T equipment for some undergraduate courses to
be offered in the fall. I would like to offer these students features of
the UNIX C shell. Many thanks to anyone who has knowledge of a port of 
the C shell to System V.

dg@wrs.UUCP (David Goodenough) (07/14/87)

In article <9904@duke.cs.duke.edu> lhb@duke.cs.duke.edu (Pete Boyd) writes:
>We are planning to e AT&T equipment for some undergraduate courses to
>be offered in the fall. I would like to offer these students features of
>the UNIX C shell. Many thanks to anyone who has knowledge of a port of 
>the C shell to System V.

Could be a problem - as far as I know only BSD UNIX supports job control
which was one of the main reasons for the C shell. AT&T Unix variations
simply don't have it. You'll still be able to get history working (for
that matter I've added a history mechanism to the bourne shell - took
about three evenings if I remember)

P.S. I may be wrong about BSD being the only UNIX with job control
in which case I've got my asbestos suit ready :-)
--
		dg@wrs.UUCP - David Goodenough

					+---+
					| +-+-+
					+-+-+ |
					  +---+

wcs@ho95e.ATT.COM (Bill.Stewart) (07/16/87)

In article <9904@duke.cs.duke.edu> lhb@duke.cs.duke.edu (Pete Boyd) writes:
: We are planning to use AT&T equipment for some undergraduate courses to
: be offered in the fall. I would like to offer these students features of
: the UNIX C shell. Many thanks to anyone who has knowledge of a port of 
: the C shell to System V.
There may be commercial vendors who sell csh for the 3B series, but
they're not in the AT&T Toolchest, which is the mechanism for selling
unsupported internal software.

In article <242@wrs.UUCP> dg@wrs.UUCP (David Goodenough) writes:
: Could be a problem - as far as I know only BSD UNIX supports job control

Which features of C shell matter to you?
- C-like Syntax (for this you really need csh)
	I've always found it easier to write programs in
	/bin/sh than in csh.  Korn Shell (ksh) is
	upward-compatible with /bin/sh, and has a number of
	additional programming features.
- History
	The Korn Shell (ksh) history mechanism supports a csh-like
	interface and an interactive-editor interface which is
	easier to use.
- Job Control
	This is really an operating system feature, not a shell
	feature, though the shell needs hooks to request
	job-control service.  Ksh supports job control on 4.*BSD.
	On System VR2 you don't have "real" job control, but
	you do have "shell layers" which help somewhat, and
	can be accessed from /bin/sh or ksh.

-- 
# Bill Stewart, AT&T Bell Labs 2G-202, Holmdel NJ 1-201-949-0705 ihnp4!ho95c!wcs

Karl.Kleinpaste@cbstr1.att.com (07/16/87)

dg@wrs.UUCP writes:
   >[SysV csh wanted.]

   Could be a problem - as far as I know only BSD UNIX supports job control
   which was one of the main reasons for the C shell.

No, the csh was written before BSD had job control.  Pieces of it
predate the existence of anything identifiable as "BSD."  Job control
was hacked in (somewhat crudely, in my opinion; little bits and pieces
of it seem to be all over the place) when 4BSD came along.

   AT&T Unix variations
   simply don't have it.

Yes and no.  SysV doesn't support SIGTSTP and friends, of course.  But
I've mentioned from time to time (as have others) that you can go a
long way toward simulating job control using ptrace(2).  My port of
csh (landlocked inside AT&T, sigh) does this.  From the user's point
of view, it is very nearly indistinguishable from 4BSD.

   P.S. I may be wrong about BSD being the only UNIX with job control
   in which case I've got my asbestos suit ready :-)

No asbestos needed, just a little erroneous history...

Karl

kimcm@olamb.UUCP (Kim Chr. Madsen) (07/16/87)

In article <242@wrs.UUCP>, dg@wrs.UUCP (David Goodenough) writes:
> Could be a problem - as far as I know only BSD UNIX supports job control
> which was one of the main reasons for the C shell. AT&T Unix variations
> simply don't have it. You'll still be able to get history working (for
> that matter I've added a history mechanism to the bourne shell - took
> about three evenings if I remember)
> 

Seems like you got the story all wrong...

The csh(1) was invented loooong before job control in the BSD systems,
job control was first introduced with 4.1BSD (as far as I remember), but
csh was around even in the days of v7 UNIX (and I suspect even in v6 - though
I'd never used that version).

The main reasons for the csh (or why many people considered csh superior to
the Bourne Shell (sh(1))) is that it had such nice features as:

	a) Command history (with execution of earlier commands)
	b) Editing utilities in earlier commands.
	c) A C-like syntax - which made it easier for some to make
	   shell scripts - instead of using the Algol-68 based /bin/sh.
	d) More build-in commands to speed up performance.
	e) The alias concept - for personalizing the interface to the
	   shell.

As for the availability of csh on SYSV machines:

	1) No csh(1) is not standard SYSV, an unconfirmed rumor says
	   that when AT&T bought the rights to BSD systems the csh was
	   considered a separate product which the folks behind Berkerly
	   was willing to sell at the same price as for the whole BSD system,
	   which AT&T refused...

	2) Some vendors supply their SYSV machines with Berkerly enhancements
	   such as the csh, strings, more, sockets etc.

	3) SCO Xenix V comes with a csh as well as other ucb utilities -
	   partly due to the bonds to v7 UNIX it still has.

	4) Some time ago a PD csh emulator (actually a bourne shell script)
	   was posted to the net it was called bsh. I don't have it but I
	   suspect it is still around on many pure SYSV machines.

					Kim Chr. Madsen.