Subject: Bash vs. Tcsh + Emacs vs Vi [was Re: bash's /dev/tcp/hostname/port]

From: Shlomi Fish <[email-masked]>
Date: Thu, 20 Jun 2002 20:25:35 +0300 (IDT)

I hope you don't mind me forwarding it to Hackers-IL. There's nothing
particularily personal in here AFAICT and I think it is of interest to the
general list.

On Thu, 20 Jun 2002, Muli Ben-Yehuda wrote:

> On Thu, Jun 20, 2002 at 04:30:25PM +0300, Shlomi Fish wrote:
> >
> > Hi!
> >
> > May I be prudent enough to ask if you have seen the light and decided to
> > dump tcsh in favour of a real (i.e: Bourne Shell-based) shell? One of the
> > most importnat items on my agenda is to convert Orr to bash... ;-)
>
> Indeed I have, several months ago. Never looked back.
>

My story is a bit more complex. During my first real UNIX job, my employer
planned that I use Linux, but eventually decided that I should use FreeBSD
instead (with tcsh). Back then, I did not notice any difference between
either Linux or Freebsd or bash or tcsh, and wrote most of my shell
scripts, except for basic pipelines in Perl. (seriously).

Later on, when I installed Linux on my home computer again, I simply used
bash because it was what came with the system. I gradually learned the
basic shell syntax, (and still learn the more advanced stuff). Then I
started studying at the Technion and was appaled by csh so I never even
considered switching to it.

> > As a side note, I know of someone who is a UNIX-guru wannabe. He used
> > XEmacs until now, and now gave gvim a test-drive. He said something that
> > it gives him more of what he needs than XEmacs does. It's interesting
> > because usually the conversion is the other way around.
>
> I work in both vi and xemacs, and xemacs is infinitely more powerfull
> - IMHO.

I don't know. He has an obsession with customizing his working environment
and building a full-fledged fully-personalized IDE. He also keeps asking
me obscure questions, some of which I can tell right away, and the rest I
have to tell him to RTFM, because I don't readily have the answer. Maybe
gvim gives him some particular features that are hard or awkward in Emacs.
I, on my part use gvim because I find Emacs to be too counter-intuitive
and inconsistent, and I could never quite get used to it. I use it only
for specialized tasks and for things that I cannot find in gvim.

Strangely enough, he uses tcsh, simply because it is available as a
login shell on all Technion servers, which is not true for bash or zsh. I
use bash whenever possible, and sometimes execute bash from within tcsh in
order to write scripts on the command-line.

Regards,

	Shlomi Fish

> --
> http://vipe.technion.ac.il/~mulix/
> http://syscalltrack.sf.net/
>

----------------------------------------------------------------------
Shlomi Fish        [email-masked]
Home Page:         http://t2.technion.ac.il/~shlomif/
Home E-mail:       [email-masked]

"Let's suppose you have a table with 2^n cups..."
"Wait a second - is n a natural number?"

---

From: "Nadav Har'El" <[email-masked]>
Date: Fri, 21 Jun 2002 02:09:41 +0300

> > I work in both vi and xemacs, and xemacs is infinitely more powerfull

This used to be true, before Bram Moolenaar started adding, in the last
few years all sorts of "crazy" features to vim. Vim now has a configuration
language, syntax highlighting and automatic indentation, window/buffer
support, spellchecking, games, very strong diff feature, very good Unicode
support and a workable Hebrew support, ctags, etc.. In short, Vim has
caught Emacs's featuritis, and caught it bad :) I know people, excellent
people ( :) ) who prefer Vim over XEmacs for what they can do with it.

Myself, I use both Vim and XEmacs. I tend to do the simpler things with
Vim and the more complex things with XEmacs, but that is more a
historical relic of the features Vi and Emacs had when I first learned them
(in 1985 and 1993, respectively), than a sign of their current feature set.

The downside to Vim's featuritis is that it is also growing in size...
On Solaris (for example), Vim's binary is 6 times larger than the ordinary
Vi. When you add Vim's /usr/local/share/vim, vim is 38 (!) times larger
than the original Solaris Vi... XEmacs is still larger - 12 times larger
than Vim on Solaris (totalling a whopping 100 MB).

> order to write scripts on the command-line.

Sometimes I get the feeling that some of the Technion's servers are treated
as a force-majeure, a force of nature that cannot be tamed or overcome...

Even the laziest sysadmin could find the time to add "/usr/local/bin/bash"
(say) to /etc/shells! After they do that, maybe they could find the time
to upgrade those 7-year-old version of Perl they have lying around :)

Seriously, though, you shouldn't really care which shells your sysadmins
"allow" you to use: I used, for years, the following trick:
use /bin/sh as your shell, but in your ~/.profile do something like

	if test -x /usr/local/bin/bash
	then
		SHELL=/usr/local/bin/bash
		export SHELL
		exec /usr/local/bin/bash --login
	fi

If you have a large enough quota (read: not the 2MB quota I once had in
the Technion in t2...) you can even compile your own bash (or zsh, or
whatever) and use that in a trick similar to above.

By the way, in Solaris (the OS used in many of the Technion's computers),
Ksh is available by standard. If you don't have bash or zsh, use ksh, which
isn't half bad. It's much better than tcsh anyway...

-- 
Nadav Har'El                        |      Friday, Jun 21 2002, 11 Tammuz 5762
[email-masked]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |Cats are smarter than dogs. You can't get
http://nadav.harel.org.il           |eight cats to pull a sled through snow.

---

From: Tzafrir Cohen <[email-masked]>
Date: Fri, 21 Jun 2002 09:29:47 +0300 (IDT)

> isn't half bad. It's much better than tcsh anyway...

Do you have history in ksh?

-- 
Tzafrir Cohen
mailto:[email-masked]
http://www.technion.ac.il/~tzafrir

---

From: Shlomi Fish <[email-masked]>
Date: Fri, 21 Jun 2002 09:23:43 +0300 (IDT)

> people ( :) ) who prefer Vim over XEmacs for what they can do with it.

As Joel Spolsky noted[1] feature-full programs need all their features,
because:

1. Enough users found them useful in order to put them in there.

2. Enough users now depend on it.

Until we come to the situation where we cannot acquire more density to our
hard-drives, we should accept Featuritis, and live with it. Maybe a few
redundant features can be removed here and there, but otherwise extra
features will always be added. Freecell Solver has many command line
options, much more than you can anticipate for a program that everything
it is supposed to do is solve Freecell and similar games. Nevertheless,
even I, the developer, found each one useful at a point.

[1] - http://www.joelonsoftware.com/articles/fog0000000020.html

I think the nice thing in Vim is that its ratio of growth is lower than
Emacs. So far, I don't think it is going to have an MUA or a web-browser
or any of those redundant features. Many macros are kept outside of the
main package.

> to upgrade those 7-year-old version of Perl they have lying around :)

Is /etc/shells a SysV'ish mis-feature? I remember I once set up a Perl
script as a shell for a dummy user I set up, and all it did was run talk.

> isn't half bad. It's much better than tcsh anyway...

Actually, I have an account on an IRIX server too...

Does ksh have auto-completion and command history?

Regards,

	Shlomi Fish

> To unsubscribe from this group, send an email to:
> [email-masked]
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>

---

From: Tzafrir Cohen <[email-masked]>
Date: Fri, 21 Jun 2002 12:02:49 +0300 (IDT)

> > (say) to /etc/shells! Afterthey do that, maybe they could find the time

Well, at least the sysadmins of TX have there:

/usr/local/gnu/bin/bash
/usr/local/bin/tcsh
/usr/local/bin/tcsh.new
/usr/local/bin/zsh

(among others)

>
> Is /etc/shells a SysV'ish mis-feature?

Certainly not.

> I remember I once set up a Perl

Since this should not cosidered as a "real" shell, it does not belong in
/etc/shells

---

From: "Nadav Har'El" <[email-masked]>
Date: Fri, 21 Jun 2002 12:34:27 +0300

> Do you have history in ksh?

Of course, and emacs/vi modes in line editing, and a lot of other cool
stuff which David Korn invented before 1988, and later found their way into
bash and zsh. Of course, a lot of new ideas have been added into shells
since 1988 (even ksh had newer versions) and you probably won't find them
in the Solaris ksh (which is why I switched from ksh to zsh).

-- 
Nadav Har'El                        |      Friday, Jun 21 2002, 11 Tammuz 5762
[email-masked]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |If you choke a Smurf, what color does it
http://nadav.harel.org.il           |turn?

---

From: "Nadav Har'El" <[email-masked]>
Date: Fri, 21 Jun 2002 12:44:12 +0300

> script as a shell for a dummy user I set up, and all it did was run talk.

/etc/shells serves two purposes, as far as I care: It prevents users from
making terrible mistakes too easily (oops, I chsh'ed my shell into /bin/ls,
what do I do now??) and it prevents people who have non-listed shells (e.g.,
/bin/false) from ftp-ing in, and similar stuff.

But it doesn't stop anyone from running a different shell! If you can
log in and run "perl", you can also make Perl appear to be your login
shell, by doing "exec perl". But if you manage do that, you probably know
what you're doing... Fresh newbies will not know how to do it, so they
are safe from changing their shell into something stupid.

> Actually, I have an account on an IRIX server too...

I have no idea if Irix has ksh - it's been years since I've had an
account on an Irix machine...

> Does ksh have auto-completion and command history?

Command history, yes. Auto-completetion? Well, actually I think it does
have filename completion (but not more suphisticated stuff), but I don't
remember (I switch from ksh to zsh around 1993, I think, so it's been quite
some time since I used ksh).
Do "man ksh" if you're interested.

-- 
Nadav Har'El                        |      Friday, Jun 21 2002, 11 Tammuz 5762
[email-masked]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |You do not need a parachute to skydive.
http://nadav.harel.org.il           |You only need one to skydive twice.