[net.sources] wanted: cshell for systemV

fjn@purdue.UUCP (Francie J Newbery) (12/28/85)

Surely I am not the first person to be hankering for cshell when 
I have to switch from my 4.2BSD Vax to my SystemV Release 2 machine.
If anyone has developed such a program (even a simplified version)
and would be willing to share it, I would be very interested in 
seeing a copy.

Thanks,
Francie Newbery

klr@hadron.UUCP (Kurt L. Reisler) (12/31/85)

In article <397@mordred.purdue.UUCP> fjn@purdue.UUCP (Francie J Newbery) writes:
>Surely I am not the first person to be hankering for cshell when 
>I have to switch from my 4.2BSD Vax to my SystemV Release 2 machine.
>If anyone has developed such a program (even a simplified version)
>and would be willing to share it, I would be very interested in 
>seeing a copy.
>
>Thanks,
>Francie Newbery

For a (relatively) small fee, you can purchase a source copy of the 
"Korn Shell" (ksh) which is a fair simulation of the ever-popular csh, with a
few added features that are quite nice.  While it is not the same old 
comfortable csh, but it is better than the standard SYS V shell.

If you need the number for the AT&T UNIX TOOLBOX, which is the "vendor" for the
Korn Shell, drop me a note at this address.  I have the number at the office.
 
 Kurt Reisler
 ..!seismo!hadron!klr

chris@globetek.UUCP (chris) (12/31/85)

In article <397@mordred.purdue.UUCP> fjn@purdue.UUCP (Francie J Newbery) writes:
>Surely I am not the first person to be hankering for cshell when 
>I have to switch from my 4.2BSD Vax to my SystemV Release 2 machine.
>If anyone has developed such a program (even a simplified version)
>and would be willing to share it, I would be very interested in 
>seeing a copy.
>
>Thanks,
>Francie Newbery

Funny you should ask for this.  Last Sunday I got so frustrated having no
command history when dialing into a local system from home that I spent the
next 7 hours amusing myself by implementing a cshell-like front-end for the
Bourne shell.  Ok, you say, very industrious, but why was it amusing?  Well,
I implemented it as a 400-line *Bourne Shell script*!  Funny thing is, it's
really surprisingly fast.  The thing which slows it down the most is eval-ing
the prompt after each command (so you can have the command number or the
date or current directory in your prompt) -- if this bit of code is removed,
you are not particularly aware your commands are being pre-processed.  I will
include a summary of the commands (still got to write the manual page *sigh*)
at the end of this article -- if enough folks are interested, I'll post it,
otherwise I'll be happy to mail it out.
--chris
:
:	Bcsh -- A Simple Cshell-Like Command Pre-Processor For The Bourne Shell
:
:	"Copyright (c) Chris Robertson, December 1985"
:
:	This software may be used for any purpose provided the original
:	copyright notice and this notice are affixed thereto.  No warranties of
:	any kind whatsoever are provided with this software, and it is hereby
:	understood that the author is not liable for any damagages arising
:	from the use of this software.
:
:	To the best of my knowledge this should work on ANY Bourne shell --
:	except that if your shell does not understand 'echo -n' you will have to
:	change the 6 or so places where this occurs.
:
:	Features:
:
:	+  simple command history
:	+  command history persists across bcsh sessions
: "	+  last-command editing via ^string1^string2 syntax or via 	"
:	   EDITOR or VISUAL editors -- defaults are 'ed' and 'vi'
:	+  aliases
:	+  sources .bcshrc on startup if present
:	+  history file name, .bcshrc file name, alias file name,
:	   number of commands seen via history command, number of commands
:	   saved on termination, etc. settable via environment variables
:	+  prompt may show current directory, command number, date, etc.
:
:	Commands:
:
:	CMND			run the Unix command CMND
:	!!			run last command+
:	!STRING			run most-recent command from history list
:				beginning with STRING -- may have extra
:				arguments at end of command
:	?STRING			run most-recent command from history list
:				containing STRING -- may have extra arguments
:				at end of command
:	!NUMBER			run command NUMBER from the history list
:				-- may have extra arguments at end of command
: "	^string1^string2^	substitute string2 for string1 in last command"
:				command and run it
:	~e			edit last command using $EDITOR
:	~v			edit last command using $VISUAL
:	logout
:	exit
:	bye			write out history file and exit+
:	h
:	history			show current history list+
:	alias NAME CMD		create an alias called NAME to run CMD
:	unalias NAME		remove the alias NAME
:	
:	commands marked with '+' are not added to the history list
:
:	In addition, the conventions of '!!:n', '!!:$', and '!!:*',
:	meaning the nth element of the previous command, the last
:	element of the previous command, and all the previous command
:	except the command name itself, are supported.
:
:	None of the colon extensions of the cshell are supported.
:
:	Shell Variables:
:
:	EDITOR		editor used by ~e command, default "ed"
:	VISUAL		editor used by ~v command, default "vi"
:	MAIL		your system mailbox
:	CHECKMAIL	interval in seconds between mail checks, default = 120
:	PAGER		paging program used by history command, default = "more"
:	history		number of commands in history list, default = 22
:	histfile	file history list is saved in, default = $HOME/.bhistory
:	savehist	number of commands remembered from last bcsh session
:	aliasfile	file of aliased commands, default = $HOME/.baliases
:
-- 

Christine Robertson  {linus, ihnp4, decvax}!utzoo!globetek!chris

Money may not buy happiness, but misery in luxury has its compensations...

cds@duke.UUCP (Craig D. Singer) (12/31/85)

In article <397@mordred.purdue.UUCP> fjn@purdue.UUCP (Francie J Newbery) writes:
>Surely I am not the first person to be hankering for cshell when 
>I have to switch from my 4.2BSD Vax to my SystemV Release 2 machine.
>If anyone has developed such a program (even a simplified version)
>and would be willing to share it, I would be very interested in 
>seeing a copy.
>
>Thanks,
>Francie Newbery

I'm not sure if what I have is what you want, but...
Here at Duke, a few of us have developed a set of C programs which have been
running on AT&T 3b2's (SysV).  The programs incorporate a history feature,
an alias mechanism, file completion keys, a nice history editor (not the
cshell "!" garbage), and some other stuff.  It's not really a cshell at all,
but rather a simulator.  It has its deficiencies, too; mainly, it creates
temporary files which sometimes cause ugly error messages like:

/tmp/cshell4033: foo: command not found

Nothing spectacular, but if you're interested, I'd be happy to pass a couple
of versions along.
-- 
 

Craig D. Singer, Dept. of Computer Science, Duke University
Durham, NC 27706-2591.  Phone (919) 684-5110  (ext.20)
CSNET: cds@duke        UUCP: ...!decvax!duke!cds
ARPA:  cds%duke@csnet-relay

gershon@ccicpg.UUCP ( Gershon Shamay) (01/02/86)

We have a BSD  csh running on our system 5. It's the 'real thing' but:
A) It only runs on our own machine (Power 6/32) with system 5.
B) Doesn't have (yet) job control because system 5 (as it comes from AT&T)
        doesn't have the support for the famous Berkeley ^Z et al.

Anyway, some of us use it a lot ( it eases the transition from 4.2 to
system 5 somewhat).
                                        Gershon Shamay

        {rlgvax, peregrine, ccice5}!ccicpg!gershon

ron@brl-sem.ARPA (Ron Natalie <ron>) (01/03/86)

> For a (relatively) small fee, you can purchase a source copy of the 
> "Korn Shell" (ksh) which is a fair simulation of the ever-popular csh, with a
> few added features that are quite nice.  While it is not the same old 
> comfortable csh, but it is better than the standard SYS V shell.
> 
I don't know what you're using, but ksh is a much hacked Bourne shell that
allows you to have features such as history, etc... that the SYS V Bourne
shell is lacking.  Fortunately it does not simulate the C-shell at all,
but uses the standard /bin/sh countrol structures and I/O redirection
primatives.

-Ron

wcs@ho95e.UUCP (Bill.Stewart.4K435.x0705) (01/06/86)

Somebody asked if you could get csh for System V; someone else replied:
>> For a (relatively) small fee, you can purchase a source copy of the 
>> "Korn Shell" (ksh) which is a fair simulation of the ever-popular csh, with a
>> few added features that are quite nice.  While it is not the same old 
>> comfortable csh, but it is better than the standard SYS V shell.

As Ron Natalie also pointed out, ksh isn't like csh, it's upward
compatible from the standard Bourne Shell (sh), and has history,
aliases, functions, and all the good things csh gives you with the same
easy-to-program-in syntax from sh.  (I might add that it does a much
better job of history than csh, and adds a number of other interesting
features.)  A few features associated with csh are really 4.*BSD
features, like ^Z job control; if your OS doesn't provide them, your
shell can't either (ksh does the right thing with ^Z if it has OS
support, and supposedly can somewhat deal with SVR2 shell layers.)
But it's not csh, so if you're addicted to csh or have csh
scripts you don't want to rewrite, you really want csh.

Csh is available at AT&T under the exptools system, which is an
internal software distribution system.  Each tool has an official
provider; unfortunately, "NONE" is the official provider for csh.
I assume it's a port from 4.1BSD, and brings ugly licensing restrictions
along with it, so don't ask me to mail you the binaries (I don't have
source).  Does anyone know its status, or who ported it?
				Thanks;
-- 
# Bill Stewart, AT&T Bell Labs 2G-202, Holmdel NJ 1-201-949-0705 ihnp4!ho95c!wcs

kozowski@reed.UUCP (Eric Kozowski) (01/07/86)

The number for the AT&T Toolchest is 1-201-522-6900.