[comp.sys.3b1] Ksh

forrie@morwyn.UUCP (Forrie Aldrich) (02/01/91)

Don't ask me why, but I would like to get the '!' (exclamation point)
in my prompt on KSH, but KSH uses that to represent the current
command number in history... anyone know how I can get the '!' in the
PS1 prompt without that behavior?

Thanks


-- 
--------------------=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--------------------
Forrest Aldrich, Jr.|   ...uunet!eci!morwyn!forrie       |forrie@morywn.UUCP
                    |  ...uunet!eci!zinn!morwyn!forrie   | 
CREATIVE CONNECTIONS|...uunet!unhd!unhtel!morwyn!forrie  |Graphic Illustration
------------------\-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-/------------------
                   \___ PO Box 1541 - Dover, NH  03820 ___/                   

forrie@morwyn.UUCP (Forrie Aldrich) (02/01/91)

I recall some people discussing the recent version of KSH
that is out (available through the toolchest for a nominall $$FEE$$).

Well, I had a thought:  if someone KNEW someone who HAD this src
and the license, etc... maybe we could work out a deal where the
person would compile it for the 3b1 and distribute it for a small
fee (or free?)... depending on what the legalities are...

Anyone have any leads?

Forrie
-- 
--------------------=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--------------------
Forrest Aldrich, Jr.|   ...uunet!eci!morwyn!forrie       |forrie@morywn.UUCP
                    |  ...uunet!eci!zinn!morwyn!forrie   | 
CREATIVE CONNECTIONS|...uunet!unhd!unhtel!morwyn!forrie  |Graphic Illustration
------------------\-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-/------------------
                   \___ PO Box 1541 - Dover, NH  03820 ___/                   

n138ct@tamuts.tamu.edu (Brent Burton) (02/01/91)

In ksh, I remember the main prompt being PS1.  So,
it would be something like:
    SET PS1="MY-PROMPT\!"


I hope this is right; I don't like /bin/ksh.

             +----------------------+--------------------------+
             | Brent P. Burton      | n138ct@tamuts.tamu.edu   |
             | Texas A&M University | Computer Science/Physics |
             +----------------------+--------------------------+

dave@galaxia.Newport.RI.US (David H. Brierley) (02/06/91)

In article <54@morwyn.UUCP> forrie@morwyn.UUCP (Forrie Aldrich) writes:
>Well, I had a thought:  if someone KNEW someone who HAD this src
>and the license, etc... maybe we could work out a deal where the
>person would compile it for the 3b1 and distribute it for a small
>fee (or free?)... depending on what the legalities are...

This is possible but not very probable.  The source code for ksh88e costs
approximately $3000, plus maybe $50 for transmission charges, plus a couple
of hundred for obtaining the Toolchest license in the first place.  Let's say
the whole thing will cost $3500.  For that price you are allowed to compile
and install the program on all machines that are owned by the organization
that holds the Toolchest license.  However, what Forrie is asking for is to
be able to distribute the binaries to other machines that are not owned by
the license holder.  This is not covered under the original $3000 fee but is
available for a measly $10000 (ten thousand) extra!  This brings the total
price for obtaining the source and a license which allows you to distribute
binary copies to approximately $13500.  I don't know about you but I don't
have that kind of money lying around idle.  In order to convince someone that
it would be economically feasible to do this you would have to get
*gauranteed* orders from enough people to pay for the software.  This means
that you would need either 135 people who were willing to pay $100 or 270
people who would pay $50 or some other combination that totals up to $13500.

Here's what I would like to do:  if you would be willing to pay for a copy of
ksh88e for the 3b1 send me mail saying so and indicate what your top price
would be.  If I get enough reponses to make it economically feasible I will
then ask everyone to send me a check for the cost of the software divided by
the number of people who respond.  Once I get all the money I will buy the
software and send everyone a diskette containing a compiled copy of ksh88e.

I realize that this sounds a little like a scam but I am actually willing to
do this if there is enough support.  There is no way I could shell out that
kind of money without taking a collection first so it is not possible for me
to purchase the software and then trust that I can sell enough copies to get
my money back.  If I get a really overwhelming response maybe I could check
on getting some of the other goodies that they have available on the
Toolchest.

Again, this is a legitimate offer.  If you are willing to pay money for a
copy of ksh88e, send me e-mail now.  Do not send me any money unless I send
you mail back indicating how much money you should send.  The more people
that are willing to purchase a copy, the less each copy will cost.  I am not
trying to make any money out of this, I am just trying to provide a service
to the 3b1 community without losing any money.

P.S. All of this is contingent on my re-reading the Toolchest license
agreement and verifying that my understanding of the terms of the license
are in fact correct.  For example, if there are any fees that have to be paid
to ATT for each binary copy that is sold then this would probably raise the
price too much.
-- 
David H. Brierley
Home: dave@galaxia.newport.ri.us; Work: dhb@quahog.ssd.ray.com
Send comp.sources.3b1 submissions to comp-sources-3b1@galaxia.newport.ri.us
%% Can I be excused, my brain is full. **

cliu@rnd.GBA.NYU.EDU (Crocker H. Liu) (02/06/91)

In article <11688@helios.TAMU.EDU> Brent Burton writes:
>
>In ksh, I remember the main prompt being PS1.  So,
>it would be something like:
>    SET PS1="MY-PROMPT\!"
>

Actually, this won't work.  To get a ! in your prompt you just need to
put use two exclamation marks, !!.  I'll use my prompt as an example.
Sometimes I'm nested several deep in invocations of ksh.  Each time I
invoke a new ksh, I keep track of how deep I am by adding another
exclamation point to my prompt.  For example, if I have just logged in
my prompt looks like:

/u/crocker>

If I now run a new ksh, the prompt changes to:

/u/crocker!>

When I exit from the ksh, the exclamation point is removed.  My
~/.profile looks like:

# shell used by emacs
ESHELL=/bin/ksh;	export ESHELL

# ksh startup commands file
ENV=$HOME/.env;		export ENV

# I use a modified window manager, so that I can create multiple
# windows and log in to each.  Each window gets its own history file.
TTY="`tty`"
HISTFILE="$HOME/.ksh`basename $TTY`";	export HISTFILE
trap "rm $HISTFILE" 0	# remove the history file on logout

# don't allow ^D for logout
case $SHELL in
*ksh)	set -o ignoreeof;;	# don't allow ^D for logout
esac

Since the prompt depends on the level of nesting of ksh, it is set in
the ksh commands file, ~/.env:

set +o verbose
case $- in
*i*)	# interactive
	set -o emacs
	set -o monitor
	alias h='fc -l | tail -23 | more -c
	alias c='clear'
	alias w='whence'
	alias v='dvi3b1 /tmp/TeXzap.dvi'
# Add two exclamation marks each time ksh is invoked.
# In the prompt this shows up as one added exclamation point
	level="${level}!!"; export level
# Remove one pair of exclamation points, so that the lowest level
# prompt doesn't show any exclamation points.  Since the ksh invoked
# in emacs by the M-x shell command is the second level of nesting,
# one needs to remove two pairs of exclamation points to have the
# lowest level prompt not show any exclamation points.
	if [ "$EMACS" ]
	then	PS1='$PWD'${level#!!!!}'> '
	else	PS1='$PWD'${level#!!}'> '
	fi
	;;
*)	set -o errexit
	;;
esac
[ "$EMACS" ] && set -o verbose

The prompt uses '$PWD' instead of "$PWD" because the latter would be
immediately evaluated when ~/.env is executed, instead of being
evaluated each time the prompt is displayed.  Unlike the current
directory, the level of nesting doesn't change, so that part of the
prompt can be evaluated once and for all when the ~/.env file is run
through.

Hope this helps!
.........................................................................
Crocker Liu  INTERNET:  cliu@rnd.gba.nyu.edu
             USENET: ...!{uunet,rocky,harvard}!cmcl2!rnd!cliu

krohn@cellar.bae.bellcore.com (Eric Krohn) (02/13/91)

In article <1199@galaxia.Newport.RI.US>, dave@galaxia.Newport.RI.US (David H. Brierley) writes:
|> This [binary license] is not covered under the original $3000 fee but is
|> available for a measly $10000 (ten thousand) extra!  

When I checked yesterday on the AT&T Toolchest, the binary sublicensing fee
was $20,000, not $10,000.  That makes the economics even worse.

Of course, there is no restriction on the types of machines involved, so one
could also resell ksh88e binaries for other UNIX machines, too.  That could
tip the scales in favor of such a scheme.

Is the ksh from Aspen Technologies that far behind ksh88e or are their
prices really that high?

The ksh86 from the STORE! (now from osu) is enough of an improvement over
the UNIX PC's stock ksh that I would find it hard to justify spending
more than about $75 on a new ksh88e.  (And yes I am quite familiar with both
versions and know that ksh88e is nicer.)

|> If I get a really overwhelming response maybe I could check
|> on getting some of the other goodies that they have available on the
|> Toolchest.

Nawk would be nice (but perl is better :-).
Sam would be really nice (ported to mgr, of course).

-- 
Eric J. Krohn
krohn@bae.bellcore.com  or  uunet!bellcore!bae!krohn
Bell Communications Research,	444 Hoes Ln,    Piscataway, NJ 08854

templon@copper.ucs.indiana.edu (jeffrey templon) (02/13/91)

In article <1991Feb13.142721.26896@bellcore.bellcore.com> krohn@bae.bellcore.com writes:
>
>Nawk would be nice (but perl is better :-).

I think this is not a problem, since GNU Awk (gawk) conforms to nawk
specifications.  It should run on the 3b1 - after all, one of the
maintainers is arnold robbins who i think is a 3b1'er.  Source code is
available from the usual place, prep.ai.mit.edu.

					jeff

jwbirdsa@amc-gw.amc.com (James Birdsall) (02/16/91)

In article <1991Feb13.154407.4456@bronze.ucs.indiana.edu> templon@copper.ucs.indiana.edu (jeffrey templon) writes:
>In article <1991Feb13.142721.26896@bellcore.bellcore.com> krohn@bae.bellcore.com writes:
>>
>>Nawk would be nice (but perl is better :-).
>
>I think this is not a problem, since GNU Awk (gawk) conforms to nawk
>specifications.  It should run on the 3b1...

Gawk compiles and runs on the 3B1 without trouble. All you have to do is
sit down with the 3B1 manuals and the makefile and figure out what macros
need to be set. I also replaced the alloca.s which came with gawk with the
alloca.s from OSU.

I don't have any awk test suites, but I haven't seen any problems yet.

>  Source code is
>available from the usual place, prep.ai.mit.edu.

Warning: source code is also huge. The uncompressed tar was around 900K as
I recall. It compresses to 400+ K, which is still huge.

-- 
James W. Birdsall   WORK: jwbirdsa@amc.com   {uunet,uw-coco}!amc-gw!jwbirdsa
HOME: {uunet,uw-coco}!amc-gw!picarefy!jwbirdsa OTHER: 71261.1731@compuserve.com
"The OS shouldn't die every time the controller drools on a sector." -- a sysop
=========== "For it is the doom of men that they forget." -- Merlin ===========

ssb@quest.UUCP (Scott Bertilson) (02/16/91)

  I recently installed the new version of "ksh" from the archive on
"cheops" and was disappointed to find that it doesn't cooperate with
"vi" very well.  I *often* use
	:!mv % orig/%
when I'm hacking on something received over the net and have been
very disappointed to find that it now fails because "vi" sets the
high bit on each character of "%" when expanding it and "ksh" apparently
doesn't strip them like "sh" and the old "ksh" used to.  (This is of
course only 1 example of the sort of thing the "%" character is handy
for.)
  I guess the only idea that comes to mind would be to zap the code
in "vi" which does this, but I'd sure prefer a simpler solution.
I also worry a little about unforeseen consequences.
				Scott S. Bertilson
				ssb%quest.UUCP@cs.umn.edu
				scott@poincare.geom.umn.edu
-- 

Scott S. Bertilson   ...ssb@quest.UUCP
			scott@poincare.geom.umn.edu

pcg@cs.aber.ac.uk (Piercarlo Grandi) (02/19/91)

On 13 Feb 91 14:27:21 GMT, krohn@cellar.bae.bellcore.com (Eric Krohn) said:

	[ ... about the latest AT&T ksh ... ]

krohn> When I checked yesterday on the AT&T Toolchest, the binary
krohn> sublicensing fee was $20,000, not $10,000.  That makes the
krohn> economics even worse.

There are some ksh PD clones around, and they do look pretty OK.
Consider the PD ksh, and ash, and clam, and the reactive keyboard if you
want advanced feature. You can always get tcsh if you really want a
feature laden shell. Tcsh needs csh sources, bu any University connected
guy can make a binary of tcsh for the 3b1 and distribute that. It has
already happened for 386s.

You can also try to port the line editing tty line discipline to the 3b1
from SysV/386; I think it should be a pretty easy exercise. It has been
posted to alt.sources and comp.unix.i386. I use it on my 386 without any
ksh or tcsh, just the stock bourne shell, and I like it giving history
to all commands I use, not just the shell.

krohn> Nawk would be nice (but perl is better :-).

gawk is there too. Another nice thing is the Vixie cron. Also GNU tar.
I think that two of the most useful things are the GNU fileutils, which
include a 'mv' command that will move around directories like the BSD
one, 'mmv' which renames files using patterns, and 'rh' that does the
same thing as find but is much much better.  Well, the endless list will
not be reproduced here.

krohn> Sam would be really nice (ported to mgr, of course).

Incidentally, remember elvis, the vi clone that is IMNHO a bit better
than vi itself.
--
Piercarlo Grandi                   | ARPA: pcg%uk.ac.aber.cs@nsfnet-relay.ac.uk
Dept of CS, UCW Aberystwyth        | UUCP: ...!mcsun!ukc!aber-cs!pcg
Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk