[net.unix] ksh availability

rjk@mgweed.UUCP (Randy King) (03/06/85)

<><><><>

Although I am an employee of AT&T, I have always expressed my personal
opinions of our products openly (much to the dismay of some) whether I
felt it was good, mediocre, or bad.   I say that so I don't sound like
yet another corporate commercial.

We have been using Dave's shell (ksh) for over a year now, and I can
confidently say that it has increased the efficiency of those who
have used it.  I have used Mashey's shell, Bourne's shell, and toyed
with the "csh."  All are great in their own right, but I feel that ksh
has finally pulled them all together and has improved on them.

The history functions, job control, vi mode, emacs mode, math and
array processing are incredible and a joy to use.  Seriously, if I
didn't already have it I would get it.  I'm pleased to see that it is
now available to everybody.   When I first made it the "default" shell,
I didn't tell anyone to see what would break.  After a couple of weeks
and no reports, I let folks in on it.

If you like csh and need /bin/sh compatibility, ksh will probably meet
or exceed your expectations.  When someone posting a shell archive
caveats with "use standard shell, not csh" the subset of "standard"
shells includes ksh.

Sorry again for the commercial, but I feel that this chunk of code
can benefit many folks outside of the company.  Like I said, these
are only my own opinions.
						Randy King
						AT&T-CP@MG
						ihnp4!mgweed!rjk

rjk@mgweed.UUCP (Randy King) (03/08/85)

<><><>

Geez, I sure stirred up some interest here.  I think that I can answer all
the questions asked of me by re-iterating some of Dave Korn's comments:

	Yes, ksh is available.  No, it's not $100,000K per cpu.  As I
	understand it, it is $2K per *site*; i.e. all of your CPU's
	can have it for that one-time cost.

For more info dial (201) 522-6900 at 1200 baud and log in as "guest."

						Randy King
						AT&T-CP@MG
						ihnp4!mgweed!rjk

gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (03/08/85)

> ... the subset of "standard" shells includes ksh.

Question:  Is ksh completely compatible with the SVR2 Bourne shell?
I seem to recall hearing that function definition was different..

rick@sesame.UUCP (Rick Richardson) (03/09/85)

> ... array processing are incredible and a joy to use.  Seriously, if I
> didn't already have it I would get it.  I'm pleased to see that it is
> now available to everybody.   ...
> 						Randy King

Well, I don't know about you, but it only cost me $800 for UNIX, including
the csh.  Now they want to sell me the "ksh" for another $2000.  No thanks.
This is one piece of software that for the price deserves to be pirated!

I stick with what I've done in the past: "csh" for my interactive shell,
and "sh" for all my scripts.  And wait for the "ksh" price to come down.
-- 
		Rick Richardson, PC Research, Inc.

	{genrad|ihnp4|ima}!wjh12!talcott!sesame!{rick|pcrat!rick}
		{cbosgd|harvard}!talcott!sesame!{rick|pcrat!rick}
			rick%sesame@harvard.ARPA 

guy@rlgvax.UUCP (Guy Harris) (03/11/85)

> Well, I don't know about you, but it only cost me $800 for UNIX, including
> the csh.  Now they want to sell me the "ksh" for another $2000.  No thanks.
> This is one piece of software that for the price deserves to be pirated!

Point 1:

If you got source for that $800, AT&T got ripped off and their lawyers will
want to get somebody.  The $2000 for "ksh" is for the *source* - that means
if you don't have a UNIX source license, you probably can't get "ksh" source
for $2000 anyway.

Point 2:

That $2000, if you could get it, is an *organization-wide* license.  That's
not $2K per machine.  That's $2K per UNIX system licensee.  If you have
1 site, or 10 sites, or 100 sites, you pay $2000 *once* and may then put
"ksh" up on all 1, 10, or 100 machines.

Point 3:

There is a separate provision for binary licenses.  Any company that wants
to offer "ksh" in binary form to their binary sublicensees pays, I think,
$20K - again, a *one-time* payment.  They may then offer "ksh" to all their
binary licensees for whatever price they want to charge (and can get).

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy
-- 
	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy

wcs@ho95b.UUCP (Bill Stewart) (03/13/85)

Doug Gwyn asked:
> Question:  Is ksh completely compatible with the SVR2 Bourne shell?
> I seem to recall hearing that function definition was different..

No, the Sys V R2 Bourne-shell-upgrade is not compatible with ksh.
Lots of things are different, and the ksh stuff is mostly better.
I don't have ksh source on this machine, but Korn wrote a preliminary analysis
of the differences that comes with the source.  Most of the difference are
either syntax (both shells doing the same thing, just a shade differently), or
features in ksh that aren't in SysVR2sh.  For me, the latter is the important
concern - the Korn shell history mechanism is nice (yes, I've used csh.)

There is a "batch"-like interface similar in capability to csh's history, but the
interesting interface is the VISUAL mode - the current line on your CRT is a
one-line screen-editor window into your history file; you can set EDITOR=vi or
EDITOR=*macs to get vi-style or emacs-style editing commands.

			Bill Stewart, ihnp4!ho95c!wcs

kenw@druid.UUCP (WeinertKD) (03/13/85)

One minor correction.  A SYS5R2 shell program will run under ksh, but
vice-versa may not work.  The currently available ksh will accept
either definition for functions

fun_name () {		|	function fun_name {
	stuff		|		stuff
}			|	}

This was done for compatability with the SYS5R2 shell.

	Ken Weinert

dsp@ptsfa.UUCP (David St.Pierre) (03/13/85)

One of the modes ksh uses to define functions is compatible with SV_R2.
A nice additional feature is the ability to define an ENV variable which
points to a file of functions. This effectively allows functions to
continue to be defined across sub-shells. If you use 5620 layers or shl,
you will begin to appreciate this.

I have run across an inconsistency between ksh and sh. I would be grepping
for a particular string in a large file, creating a temporary sub-file.
If I found more than one match, I wanted to provide a selection mechanism
at the terminal. The following (abbreviated) fragment shows what I did:


PROFSIDS=/usr/ladm/lib/profs_ids
TMPB=yyy

	grep -i "$1" $PROFSIDS > $TMPB
	while :
	do
		read USERID SYSTEM NAME
		if [ -z "$USERID" ]
		then
			break
		fi
			echo "NAME = $NAME, USERID = $USERID [y] \c"
			read ANS < /dev/tty
			if [ "$ANS" = "n" ]
			then
				continue
			fi
		echo "The answer was $ANS"
	done < $TMPB

In "sh", I got the results I wanted. In ksh, $TMPB was closed after a single
line was read, presumably because /dev/tty was opened in the inner loop.

I'm not sure if this is a bug or feature. And my copy of ksh may have no
resemblance to the version being offered in the toolchest.

mark@cbosgd.UUCP (Mark Horton) (03/14/85)

I've used the Korn shell also, and in general I think it's an excellent
piece of code.  Even though it comes from AT&T, there is full support for
4BSD job control, if you are on a 4BSD machine.  It's nearly identical to
the job control in csh, except that you have to restart foreground jobs
with "fg" instead of "%" (but fg works with csh too, so I just got in
the habit of typing "fg".)

In order for people not to get the wrong impression, there are two things
I want to make sure you are aware of.  The first is that ksh is quite
large - my VAX binary is 77K of text (the same size as csh), compared
to 26K for sh.  This doesn't seem to matter on a machine with paging,
but if you have a small machine or your machine doesn't page you may
see some performance differences.

The other thing is the way history is done.  If you use history as a way
to correct typos and remember or repeat that complicated command you did
15 commands ago, you'll love ksh.  You actually get your choice of vi or
emacs, in a one-line mode at the bottom of your screen, or you can do an
ed style substitution command.  (It's also possible to arrange that you
get put into vi's open mode, or your favorite editor.)  It does all this
without the foggiest idea what kind of terminal you are on, although it
only works on CRT's that don't overstrike.

If you use history as a way to save keystrokes, you may not feel the same
way.  I use the !$, !^, and !* features of vi constantly to save typing
effort (although I set my history character to , rather than ! because it's
easier to type and doesn't get in the way of UUCP commands.)  My fingers
know, at the reflexive level, that if I'm not sure what to type, the right
thing to type is ",$", which gets me the last argument to my previous command.
The user interface to the Korn shell history is completely different from
csh, and there is no direct substitute for this kind of piece-of-the-last-
command substitution.  The way you change a previous command is to go into
your editor (e.g. if you're a vi user, hit ESC, if you're an EMACS user,
just type a control letter) and you're in (an emulation of) your editor.
You can hit the "previous line" command (k or ^P) to go back in your
history list until you find the command you want, then go right to the
place you want to change, make the change, and hit return.  The return
key takes you out of the editor, and causes the shell to execute the
command (the whole thing, including the part to the right of the cursor.)
While this is very straightforward and natural, it does take a lot more
keystrokes than csh for many parameter substitution things.

Also, ksh does not have the tcsh tenex-style "escape recognition" feature,
and since it uses ESC to put you into vi (or as META for EMACS) there is
no obvious way to have both features present in either csh or ksh.

Finally, since ESC is meaningful to ksh, and since there is no System V
equivalent to the ctlecho stty bit that Berkeley has, there is no way to
stop the ESC you type from getting echoed to the terminal.  Since most
terminals do unpredictable things with ESC (like begin escape sequences)
this can cause problems.  I think the Korn shell echoes some more stuff
that it expects to cancel the current command, but this may not work on
all terminals.  It's not a problem on Berkeley UNIX.  The proper fix would
be to put ctlecho into the System V tty driver, but that's another battle.

spaf@gatech.UUCP (Gene Spafford) (03/15/85)

In article <567@rlgvax.UUCP> guy@rlgvax.UUCP (Guy Harris) writes:
>> Well, I don't know about you, but it only cost me $800 for UNIX, including
>> the csh.  Now they want to sell me the "ksh" for another $2000.  No thanks.
>> This is one piece of software that for the price deserves to be pirated!
>
>Point 1:
>
>If you got source for that $800, AT&T got ripped off and their lawyers will
>want to get somebody.  The $2000 for "ksh" is for the *source* - that means
>if you don't have a UNIX source license, you probably can't get "ksh" source

Counterpoint:
Educational institutions pay $800 to get source licenses for Unix Sys V.
Another $150 (?) will get a Berkeley distribution tape. Do you think many
of us are going to pay $2000 for ksh?  No!  Nor are many of us going
to shell out the bucks that AT&T is charging for the new uucp stuff.
I don't know about other places, but we can't afford it here.

I guess many educational institutions, especially the public ones, will
never find out if the Korn shell is all that great, or if Honey DanBer
uucp is the niftiest thing since sliced yogurt.   Whether that will
affect the future market for other AT&T goodies is beyond my ability
to forsee.
-- 
Gene "5 months and counting" Spafford
The Clouds Project, School of ICS, Georgia Tech, Atlanta GA 30332
CSNet:	Spaf @ GATech		ARPA:	Spaf%GATech.CSNet @ CSNet-Relay.ARPA
uucp:	...!{akgua,allegra,hplabs,ihnp4,linus,seismo,ulysses}!gatech!spaf

ggs@ulysses.UUCP (Griff Smith) (03/15/85)

>>> Well, I don't know about you, but it only cost me $800 for UNIX, including
>>> the csh.  Now they want to sell me the "ksh" for another $2000.  No thanks.
>>> This is one piece of software that for the price deserves to be pirated!
.
.
>>Point 1: (reasonable rebuttal)...
.
.
>Counterpoint:
>Educational institutions pay $800 to get source licenses for Unix Sys V.
>Another $150 (?) will get a Berkeley distribution tape. Do you think many
>of us are going to pay $2000 for ksh?  No!  Nor are many of us going
>to shell out the bucks that AT&T is charging for the new uucp stuff.
>I don't know about other places, but we can't afford it here.
>
>I guess many educational institutions, especially the public ones, will
>never find out if the Korn shell is all that great, or if Honey DanBer
>uucp is the niftiest thing since sliced yogurt.   Whether that will
>affect the future market for other AT&T goodies is beyond my ability
>to forsee.

I suppose the "software for the people" contingent will rise in
righteous indignation, but...

Assuming that the current academic price for System V is still $800, we
are still giving it away.  If your school can't afford normal
commercial software prices for at least some key utilities, it must be
a shoestring operation.  When I was at the University of Pittsburgh, it
was "business as usual" to shell out about $5000/year for a software
maintenance contract; we had to pay $10000 for the "virtual memory"
upgrade for our TOPS-10 operating systems.  Any useful software product
usually cost us at least $1000, and some were in the $5000 to $10000
range.  A large product such as DISSPLA/TEL-A-GRAF had a special
educational rate of "only" $20000; the commercial rate was at least
$80000.

The Korn shell is a good product!  I used csh for a year; then Dave
finally added BSD (i. e. real) job control and command edit mode to
ksh.  I switched, and haven't looked back.  Given the improvements it
can add to your computing environment, the price is low by commercial
standards.

Credits:
UNIX is a trademark of my employer.
TOPS-10 is probably still a trademark of Digital Equipment Corporation.
DISSPLA and TEL-A-GRAF (or some variation of those spellings) are
	trademarks of ISSCO.

Disclaimer:
Prices are guesses, opinions are mine.
-- 

Griff Smith	AT&T Bell Laboratories, Murray Hill
Phone:		(201) 582-7736
Internet:	ggs@ulysses.uucp
UUCP:		ulysses!ggs  ( {allegra|ihnp4}!ulysses!ggs )

spaf@gatech.UUCP (Gene Spafford) (03/15/85)

I got some feedback on on my posting about not being able to afford the
cost of the Korn shell or Honey DanBer.  It was suggested that we're a
"shoestring" operation if we can't afford the few thousand dollars
required to license those items.

The following was discussed a great deal in net.cse over the past
year, so I feel very certain that we're not the only educational
institution in this situation:

We're a public university.  We're a public university in a state that
doesn't place a high priority on education (as is the case in most
states).  We're a public university in a state where the majority of
state and federal legislators didn't attend our school -- in fact, most
of them attended the rival university across-state.  Our
student-faculty ratios are too high, our equipment is outdated and
undersized, and we don't have any budget for software packages unless
some faculty member wants it for study under one of their grants.
We're not that different from most other educational institutions
around the country.  Only a few places have the funds to pay a couple
thousand a pop out of petty cash for software packages.  Here, we worry
if the general budget will have sufficient funds left so we can buy
paper for the last month out of each fiscal year.

Let me point out that we don't run the computing services on campus.
We only run the research machines and some of the teaching machines.
The main campus computing facility is two Cyber 855's running NOS.
Will the ksh run under NOS?  If so, maybe we can talk somebody in the
computing services department to budget for it.

We're not a shoestring operation here.  We have about 30 faculty
members, 200 graduate students (including about 50 PhD students), and
about 600 undergraduates.  We provide all of those students with a
fine, in-depth education even though the resources aren't available to
make it as complete as some would wish.  We don't teach Unix or C,
although some grad students and selected undergrads may be exposed to
it during some of their work.  We just happen to have not enough
funding for the number of students and the kind of quality we try to
provide.  It doesn't look like that will change anytime soon, for us,
or for other schools in similar situations.  Unless of course we can
convince the current administration that we're a vital part of the
defense program in this country and we can get budgeted a few hundred
thousand dollars for screwdrivers and coffee makers.

Further discussion on this topic should probably be in net.cse; I have
provided a "Followup-to" line to reflect that.
-- 
Gene "5 months and counting" Spafford
The Clouds Project, School of ICS, Georgia Tech, Atlanta GA 30332
CSNet:	Spaf @ GATech		ARPA:	Spaf%GATech.CSNet @ CSNet-Relay.ARPA
uucp:	...!{akgua,allegra,hplabs,ihnp4,linus,seismo,ulysses}!gatech!spaf

gam@amdahl.UUCP (G A Moffett) (03/16/85)

> Doug Gwyn asked:
> > Question:  Is ksh completely compatible with the SVR2 Bourne shell?
> > I seem to recall hearing that function definition was different..
> 
> No, the Sys V R2 Bourne-shell-upgrade is not compatible with ksh.
> Lots of things are different, and the ksh stuff is mostly better.
>
> 			Bill Stewart, ihnp4!ho95c!wcs

This is rather misleading and the author should explain exactly
what IS different about the ksh.  As far as I can tell, the only
difference in upward compatability is that ksh no longer supports
'^' as an alternate pipe symbol.

There are ksh aliases that impliment things like 'echo', 'false', 'pwd',
but these would be functionally identical to what the sh user would
expect. Functions from sh are compatable as well.

[ Yes, we actually have ksh here; I am only just starting to use
it myself ]

I would like to see more experience-derived info about the ksh
for the many beginners like myself.
-- 
Gordon A. Moffett		...!{ihnp4,hplabs,sun}!amdahl!gam

ignatz@aicchi.UUCP (Ihnat) (03/16/85)

In his article, Randy King apologetically praises Dave's ksh.
No apology is needed; it's truly an outstanding product, and
deserves whatever praise it gets.  While I was on contract at
Bell Labs, I used it extensively; now that my contract is over,
I miss it intensely.  But I do have to take exception with the
claim that it's available.

Yes, it now can be bought; but, according to the "AT&T Toolchest",
which I called just to make sure I'm not mistaken, it's $2000 per site for
a source license, and  $20000 for a vendor license for object
redistribution.  Also, not mentioned by the Toolchest, but certified
as applicable by another source, is that you must have a System V
source license to buy the source.

I'm sorry, but I hate to break it to AT&T that most sites don't need or
want System V source licenses.  Many purchase a machine for which a
vendor has done the port; they can afford the object license, but as
businesses have neither need, desire, nor cash to buy their own source
license--let the vendor fix bugs.  Yet, at $20000, the vendors are going
to have to charge a substantial sum to recoup their loss on the ksh
source.  Try to explain to a bursar or comptroller why you want to spend
hundreds to thousands of dollars on a new shell--I dare you.  The fact
of the matter is that, whether we like it or not, it'll be darn hard
to justify significant cash expenditure for a tool which will replace
a tool which is currently doing the job, be it 'sh' or 'csh'.

The same applies for the honey-danber uucp package (which, I was surprised
to note, is *not* offered on the Toolchest menu).  Apparently, $2000/object
license (could someone verify--is that per *machine*, or *organization*?
In any case, it's extreme).  Again, try to justify that type of cash
outlay to an organization which has a tool that works already.  Yes, I
have to nurse it, watch it, and beat on it--but I'm already doing that,
and we're getting our mail and uucp traffic, sooner or later.

All of the preceeding totally ignores the fact that the number of Venix-
and Xenix-based small Unix(Tm) systems, owned by both individuals and 
businesses, is huge, and that AT&T is agressively marketing the 3B2.
Obviously, the average individual cannot afford a source license, or
a $2000 object license, or...

Finally, I question the propriety of overcharging in the extreme for the
practice of, effectively, offering corrected versions of products which are
*already* provided with the existing software, but are so bug-ridden as
to be apocryphal.

No...I don't think that ksh (or, for that matter, honey-danber uucp) is
really available to Unix users yet.  As I said before, I applaud the efforts
of Dave, Pete, Dan, and Brian; "they done good, real good".  And I can
understand that it's difficult for AT&T to figure out immediately what
is the best marketing strategy, after so many years as a regulated monopoly.
But, in the end, I'm the one with a Unix machine at work, and one at home,
and can't justify the cash outlay for the tools at work, and can't afford it at
home; and that's the bottom line.  If it's not affordable, it's not
available.

Unix is a trademark of AT&T Bell Telephone Laboratories; probably AT&T
Toolchest, as well.

The opinions expressed herein are solely my own, and in no way necessarily
reflect the opinions, attitudes, or policies of my employer.

-- 
	Dave Ihnat
	Analysts International Corporation
	(312) 882-4673
	ihnp4!aicchi!ignatz

gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (03/17/85)

AT&T is clearly following the lead of other software mass marketers
in expecting "VARs" to be the redistributers of their products.
It is indeed unfortunate that many of the people who helped make
UNIX a commercial success are getting squeezed by the pricing.
Any constructive suggestions that AT&T could seriously consider?

naiman@pegasus.UUCP (Ephrayim J. Naiman) (03/20/85)

<munch, munch>

I've been using the ksh for about a year now and find that it saves
me about 50-70% of the time I used to spend typing at the command line.
So .... throw my vote in for a YES on the ksh.
-- 

==> Ephrayim J. Naiman @ AT&T Information Systems Laboratories (201) 576-6259
Paths: [ihnp4, allegra, ahuta, maxvax, cbosgd, lzmi, ...]!pegasus!naiman

naiman@pegasus.UUCP (Ephrayim J. Naiman) (03/20/85)

Newsgroups: net.followup,net.unix
<munch, munch>

I've been using the ksh for about a year now and find that it saves
me about 50-70% of the time I used to spend typing at the command line.
So .... throw my vote in for a YES on the ksh.

-- 

==> Ephrayim J. Naiman @ AT&T Information Systems Laboratories (201) 576-6259
Paths: [ihnp4, allegra, ahuta, maxvax, cbosgd, lzmi, ...]!pegasus!naiman

bob@islenet.UUCP (Robert P. Cunningham) (03/22/85)

> It is indeed unfortunate that many of the people who helped make
> UNIX a commercial success are getting squeezed by the pricing.
> Any constructive suggestions that AT&T could seriously consider?

Perhaps AT&T leadership will once again see the wisdom in helping to
support U.S. higher education, and consider giving software such as ksh
to universities ... and incidentally gaining a $2,000 per-gift tax
deduction.
-- 
Bob Cunningham   ..{dual,ihnp4,vortex}!islenet!bob
Honolulu, Hawaii