[comp.unix.wizards] Why csh still wins

dce@mips.COM (David Elliott) (08/28/88)

In article <2323@munnari.oz> kre@munnari.oz (Robert Elz) writes:
>In article <2402@rtech.rtech.com>, daveb@llama.rtech.UUCP (Dave Brower) writes:
>> [Quotes:] >% mkdir {man,cat}{1,2,3,4,5,6,7,8}
>> This is the single, lonesome, only thing that I like about csh that
>> isn't done adequately or better in ksh or the BRL sh.
>
>It is an important one, but !$ is just as important.  I have never used
>a BRL sh, but ksh's $_ (while useful itself sometimes), just doesn't come
>close.
...
>neither of which will do anything like what you want if you replace
>csh with ksh and !$ with $_

I'm not sure I understand what the problem is.  All the csh people
are saying "we like some of the csh features", and the ksh people
keep saying "you don't need them".  This kind of attitude is what is
going to keep ksh from supplanting csh in the near future.

Look, Dave Korn and anyone else that has the power to change ksh, add
curly braces and csh-style history substitution to ksh -- and when I
say add, make them optional so nobody is forced into anything -- and
a lot of us will switch over.

Oh sure, there are still a crowd of csh programmers out there, but only
about half of them do it because they only want to learn one shell language
(the other half do it because they somehow got the idea that they can't
run sh scripts from csh).  Make ksh a complete replacement for csh, and
more people will buy it (make it part of the standard AT&T System V, or
better yet public domain, and everyone will thank you).

Then again, there's always those great folks at BRL who will do it
for you.  Maybe *they* should be the ones doing Unix (half :-).

greim@sbsvax.UUCP (Michael Greim) (08/30/88)

To join the recent discussion about
sh / csh / ksh / brl-sh (?) / tcsh ...

In <2910@dunkshot.mips.COM> dce@dunkshot (David Elliott) writes:
>I'm not sure I understand what the problem is.  All the csh people
>are saying "we like some of the csh features", and the ksh people
>keep saying "you don't need them".  This kind of attitude is what is
>going to keep ksh from supplanting csh in the near future.

>
>Look, Dave Korn and anyone else that has the power to change ksh, add
>curly braces and csh-style history substitution to ksh -- and when I
>say add, make them optional so nobody is forced into anything -- and
>a lot of us will switch over.
Maybe, see below.

>
>Oh sure, there are still a crowd of csh programmers out there, but only
>about half of them do it because they only want to learn one shell language
>(the other half do it because they somehow got the idea that they can't
>run sh scripts from csh).  Make ksh a complete replacement for csh, and
>more people will buy it (make it part of the standard AT&T System V, or
>better yet public domain, and everyone will thank you).
Agreed.

We are running BSD4.3 on 2 VAX 11/780, SUN-OS 3.5 on some SUN 3/150,
ULTRIX (some-or-the-other) on a VAX 8600. On all these systems there
is csh. For interactive work most people prefer csh, simply because of
its history mechanism and job control features. For scripts we use
sh where speed counts. I would like to try out ksh, but we have been
told that it is not Public Domain but that it costs some (relativly small)
amount of dollars.
How should we convince the people at our University, who pay the bills,
that we need to buy another shell just for trying it out?
We had problems enough recently when we wanted to get FrameMaker (tm)
for our SUNs.
We have the diffs for tcsh and we have a source license for 4.3BSD, thus
including csh. So we could upgrade csh.
But:
- we cannot do this legally (yet) on our SUNs and under ULTRIX. 
- we have made a lot of changes to csh, especially a lot of test
	output and bugfixes (posted to the net some months ago), which will
	probably (!) cause patch to work wrong.
	I have simply been to lazy to try it.

ksh seems to be better than csh, but as long as we don't have it
(we are trying), we still use csh.

	-mg
-- 
UUCP:  ...!uunet!unido!sbsvax!greim   | Michael T. Greim
       or greim@sbsvax.UUCP           | Universitaet des Saarlandes
CSNET: greim%sbsvax.uucp@Germany.CSnet| FB 10 - Informatik (Dept. of CS)
ARPA:  greim%sbsvax.uucp@uunet.UU.NET | Bau 36, Im Stadtwald 15
voice: +49 681 302 2434               | D-6600 Saarbruecken 11, West Germany

# include <disclaimers/std.h>

gwyn@smoke.ARPA (Doug Gwyn ) (08/31/88)

In article <2910@dunkshot.mips.COM> dce@dunkshot.UUCP (David Elliott) writes:
>Then again, there's always those great folks at BRL who will do it
>for you.  Maybe *they* should be the ones doing Unix (half :-).

Thanks.  We tried that for a while, but our bosses don't think that's
what we're being paid for.  Never mind the fact that it would be a far
better return on the taxpayers' dollars.

aperez@cvbnet2.UUCP (Arturo Perez Ext.) (09/03/88)

From article <2910@dunkshot.mips.COM>, by dce@mips.COM (David Elliott):
> In article <2323@munnari.oz> kre@munnari.oz (Robert Elz) writes:
>>In article <2402@rtech.rtech.com>, daveb@llama.rtech.UUCP (Dave Brower) writes:
>>> [Quotes:] >% mkdir {man,cat}{1,2,3,4,5,6,7,8}
>>> This is the single, lonesome, only thing that I like about csh that
>>> isn't done adequately or better in ksh or the BRL sh.
>>
>>It is an important one, but !$ is just as important.  I have never used
>>a BRL sh, but ksh's $_ (while useful itself sometimes), just doesn't come
>>close.
> ....
>>neither of which will do anything like what you want if you replace
>>csh with ksh and !$ with $_
> 
> I'm not sure I understand what the problem is.  All the csh people
> are saying "we like some of the csh features", and the ksh people
> keep saying "you don't need them".  This kind of attitude is what is
> going to keep ksh from supplanting csh in the near future.
> 

Correct me if I am wrong, but I thought the main reason people
continued to use the C shell is because it has job control.  I don't
have access to a ksh so I don't know anything about it, really.

Speaking for myself, the only reason I don't use the Bourne shell
is because it doesn't have job control.  I've seen an implementation
of a history mechanism in the Bourne shell in a SCRIPT!  The Bourne
shell's syntax is cleaner and new 'mantras' of shell programming
tricks can be deduced from the logic of the shell language structure.
As I understand it the Korn shell is basically a cleanup of the
Bourne shell with an optional job control feature and added math
builtins.


I must admit. I have NEVER been able to really use the Cshell
in any meaningful manner in terms of scripts.  The Bourne shells
intuitive language structure wins for me every time.  Really, why
should I have to worry about where I put the space in the "set"
command?

I was never so amazed as when I needed a double evaluation and
tried the logically obvious command

	'ls -l \`which man\``

(actual commands changed to protect the guilty :-)  AND IT WORKED.

How likely is that under the C shell?


Arturo Perez
ComputerVision, a division of Prime
primerd!cvbnet!aperez
The difference between genius and idiocy is that genius has its limits.

dce@mips.COM (David Elliott) (09/04/88)

In article <194@cvbnet2.UUCP> aperez@cvbnet2.UUCP (Arturo Perez Ext.) writes:
>Correct me if I am wrong, but I thought the main reason people
>continued to use the C shell is because it has job control.  I don't
>have access to a ksh so I don't know anything about it, really.

1. There are System V-based systems without job control but with csh.

2. There are versions of sh, including ksh, that support job control
   on systems with job control (BSD, AUX, etc.).

I'm not sure if you meant it this way, but I've had a lot of people ask
me "Do we have csh on System V? I really like job control".  The shell
only implements a job control interface, the actual job control is done
by the kernel.

Ksh has job control interface support in it, so ksh on a system with
job control will allow you to stop, foreground, and background jobs.

I maintain that the reason people stick with csh is that they are used
to the interface and would prefer not to change.

I'd also like to ask that the person who said that they could do
the function of !$ with less keystrokes would show us.  As a challenge,
please reproduce:

	% ls -l /etc/pass*
	...
	% size !$
	{equivalent to "size /etc/pass*"}

-- 
David Elliott		dce@mips.com  or  {ames,prls,pyramid,decwrl}!mips!dce

gwyn@smoke.ARPA (Doug Gwyn ) (09/05/88)

In article <194@cvbnet2.UUCP> aperez@cvbnet2.UUCP (Arturo Perez Ext.) writes:
>Speaking for myself, the only reason I don't use the Bourne shell
>is because it doesn't have job control.  I've seen an implementation
>of a history mechanism in the Bourne shell in a SCRIPT!

The BRL edition of the SVR2 Bourne shell has had job control (on
systems that support it) for years, and now has command history
and EMACS-like editing.  In fact we have little motivation to
pay extra for a Korn shell.

lear@NET.BIO.NET (Eliot Lear) (09/05/88)

AND!  It has bindable functions, like play-game-of-life-on-current-line!

How can a shell survive without such functionality????
-- 
Eliot Lear
[lear@net.bio.net]

bph@buengc.BU.EDU (Blair P. Houghton) (09/08/88)

In article <194@cvbnet2.UUCP> aperez@cvbnet2.UUCP (Arturo Perez Ext.) writes:
>I must admit. I have NEVER been able to really use the Cshell
>in any meaningful manner in terms of scripts.  The Bourne shells
>intuitive language structure wins for me every time.

I pretty well remember (watch me not go look it up :-() something
in the man pages for csh and sh that remarks the main difference
between them is that sh is more suited for scripts while csh
is more suited for interactive shells.

				--Blair
				  "Two cents still buys
				   a lot of kibbitz around
				   these parts..."

nate@mipos2.intel.com (Nate Hess) (09/09/88)

In article <3048@dunkshot.mips.COM>, dce@mips (David Elliott) writes:
>As a challenge, please reproduce:
>
>	% ls -l /etc/pass*
>	...
>	% size !$
>	{equivalent to "size /etc/pass*"}


Or, for even more funky fun:


% ls -lsgF `whereis motd | awk '{ print $2 }'`
...
% cat !$


No, of course this doesn't have any Real(tm) use...  :-)#

--woodstock
-- 
	   "What I like is when you're looking and thinking and looking
	   and thinking...and suddenly you wake up."   - Hobbes

nate@mipos3.intel.com     ...!{decwrl|hplabs!oliveb|amd}!intelca!mipos3!nate