[comp.unix.shell] Questions concerning BaSH

jc@bu-pub.bu.edu (James Cameron) (01/08/91)

I have seen a few references to Bash.  I was just curious as to where
I can get it, and what are the pros cons in comparison to tsch.

Thanks!

jc

de5@ornl.gov (Dave Sill) (01/09/91)

In article <71792@bu.edu.bu.edu>, jc@bu-pub.bu.edu (James Cameron) writes:
>I have seen a few references to Bash.  I was just curious as to where
>I can get it, and what are the pros cons in comparison to tsch.

Where to get it:

Host labrea.stanford.edu (36.8.0.47)
Last updated 13:12 10 Dec 1990
    Location: pub/gnu
      FILE      rw-rw-r--  389006  Mar 10  1990   bash-1.05.tar.Z

Host munnari.oz.au (128.250.1.21)
Last updated 12:41 10 Dec 1990
    Location: gnu
      FILE      rw-r--r--  389006  Mar 19  1990   bash-1.05.tar.Z

Host trantor.harris-atd.com (26.13.0.98)
Last updated 18:20 9 Dec 1990
    Location: gnu
      FILE      rw-r--r--  389006  Jun 28 18:19   bash-1.05.tar.Z

Host tut.cis.ohio-state.edu (128.146.8.60)
Last updated 18:17 9 Dec 1990
    Location: pub/gnu/bash
      FILE      rw-r--r--  389006  Mar  4  1990   bash-1.05.tar.Z

Host uunet.uu.net (192.48.96.2)
Last updated 17:52 9 Dec 1990
    Location: gnu
      FILE      rw-r--r--  389006  Mar 13  1990   bash-1.05.tar.Z

Pros/Cons vs. TCSH

+Doesn't require CSH source
+Is Bourne compatible, but with CSH-style history & job control
-Is less mature, hence buggier
+Is more customizable; keys are easily rebound
+Has shell functions

-- 
Dave Sill (de5@ornl.gov)	  It will be a great day when our schools have
Martin Marietta Energy Systems    all the money they need and the Air Force
Workstation Support               has to hold a bake sale to buy a new bomber.

fischer@iesd.auc.dk (Lars P. Fischer) (01/09/91)

>>>>> On 8 Jan 91 15:47:46 GMT, jc@bu-pub.bu.edu (James Cameron) said:

James> I have seen a few references to Bash.  I was just curious as to where
James> I can get it, and what are the pros cons in comparison to tsch.

The Bourne Again SHell is available from prep.ai.mit.edu and several
other places.

Compared to tcsh:
  - bash i sh syntax, which is much nicer and what you use for scripts
    anyway. Being able to pipe output from a loop i a must.
  - bash has a more powerful command line editor, ie. you can search
    for a line containing any string, etc.
  - the command line editor used in bash is available as a library for
    use in other programs. If you change the key bindings, it takes
    effect in *all* programs that use the command line editor. I like
    this a lot for use in gdb etc.
  - command line editing lets you retrieve individual lines from a
    loop, say. Being able to get the first line only is a true tcsh
    brain damage.
  - You get the src to hack.
  - The price is right :-)

Overall, it's a matter of preference: sh or csh. I used to be a csh
user, but nowadays I much prefer sh.


Try it.

/Lars
--
Lars Fischer,  fischer@iesd.auc.dk   | Q: How does a project get to be one 
CS Dept., Univ. of Aalborg, DENMARK. | year late?     A: One day at a time.

kimcm@diku.dk (Kim Christian Madsen) (01/09/91)

de5@ornl.gov (Dave Sill) writes:

>Pros/Cons vs. TCSH

>+Doesn't require CSH source
>+Is Bourne compatible, but with CSH-style history & job control
>-Is less mature, hence buggier
>+Is more customizable; keys are easily rebound
>+Has shell functions

+Has emacs like i-search and reverse-i-search.

This is a great help, for finding old commands in just a few strokes,
instead of C-p-C-p-C-p ad nauseam.



						Regards
						Kim Chr. Madsen

rock@warp.Eng.Sun.COM (Bill Petro) (01/10/91)

fischer@iesd.auc.dk (Lars P. Fischer) writes:
>>>>>> On 8 Jan 91 15:47:46 GMT, jc@bu-pub.bu.edu (James Cameron) said:
>Overall, it's a matter of preference: sh or csh. I used to be a csh
>user, but nowadays I much prefer sh.

>Try it.

>Lars Fischer,  fischer@iesd.auc.dk   | Q: How does a project get to be one 
>CS Dept., Univ. of Aalborg, DENMARK. | year late?     A: One day at a time.

How did you convert all your csh aliases back to (ba)sh style - other
than one at a time :-)  I liked the csh advantages over sh, and almost
switched to ksh, but didn't want to convert my csh aliases in .cshrc
over to (k)sh format.  Then I found tcsh which gives me command line
editing, (limited) history manipulation and very nice file completion.

I would like the "function" capabilities of ksh or bash, but don't want
the pain of converting each of my 200+ .cshrc aliases :-(

Anyone have a quick fix?


Bill "Rock" Petro - System Software Marketing


--
     Bill Petro  {decwrl,hplabs,ucbvax}!sun!Eng!rock
"UNIX for the sake of the kingdom of heaven"  Matthew 19:12

melling@cs.psu.edu (Michael D Mellinger) (01/10/91)

I found BASH 1.05 to be very unstable.  I wouldn't use it as my login
shell.  There are several major patches for it that you should be sure
to get if you decide to use it.  I might try it again when 1.06 is
released.  For now though, I recommend tcsh.

-Mike

BTW:  The BASH binary(like most GNU binaries) is quite large.

rwelch@diana.cair.du.edu (RANDY S WELCH) (01/10/91)

In article <Fpkvu754@cs.psu.edu> melling@cs.psu.edu (Michael D Mellinger) writes:

   Path: mercury.cair.du.edu!pikes!csn!ncar!zaphod.mps.ohio-state.edu!wuarchive!psuvax1!news
   From: melling@cs.psu.edu (Michael D Mellinger)
   Newsgroups: comp.unix.shell
   Date: 9 Jan 91 21:37:26 GMT
   References: <71792@bu.edu.bu.edu>
   Sender: news@cs.psu.edu (Usenet)
   Organization: Penn State Computer Science
   Lines: 9
   Nntp-Posting-Host: client6.cs.psu.edu


   I found BASH 1.05 to be very unstable.  I wouldn't use it as my login
   shell.  There are several major patches for it that you should be sure
   to get if you decide to use it.  I might try it again when 1.06 is
   released.  For now though, I recommend tcsh.

   -Mike

   BTW:  The BASH binary(like most GNU binaries) is quite large.

There are several of us in my office that use bash as a login shell.  True
you need to apply patches ( history/Sys V signal handling ), but it works
well for us.  If you need to cut down the size, get rid of the help
documentation (40K).  It has to execute scripts somewhat better than our
brain damaged csh...

-randy
-- 
Randy Welch   Mail to :  ...!ncar!scicom!bldr!randy or rwelch@du.edu
Boulder, CO   VOICE   :  303-442-6717
"Unfortunately, life contains an unavoidable element of unpredictability"
-David Lynch "The Angriest Dog in the World"

bothner@sevenlayer.cs.wisc.edu (Per Bothner) (01/11/91)

melling@cs.psu.edu (Michael D Mellinger) writes:
>I found BASH 1.05 to be very unstable.

I haven't. Very infrequently (less than once a month),
I've noticed it freeze up on me, but generally I have no problems.

>I wouldn't use it as my login shell.

I do on my home Sony (68020, bsd 4.3-based), on my friend's
DECstation3100, and I use it as my main shell (though I haven't
updated /etc/passwd) on my office DEC3100.

>There are several major patches for it that you should be sure
>to get if you decide to use it.

I just have the one patch set from prep (which you should get).

>I might try it again when 1.06 is released.

Version 1.06 is long overdue...

>For now though, I recommend tcsh.

tcsh is ok, but it is a bit of a kludge, and it requires csh
source. Also, I would advise against writing major macros
or programs using [t]csh, given that the Posix standard
(and ksh and bash) are based on Bourne shell syntax.

>BTW:  The BASH binary(like most GNU binaries) is quite large.

It's somewhat big, but not that bad (DEC3100 sizes):

-rwxr-xr-x  1 bothner    360448 Jan 10 12:13 bash*
-r-xr-xr-x  1 root       241664 Jun 26  1990 /usr/misc/tcsh*
-rwxr-xr-x  1 root       167936 Aug 16 11:24 /usr/misc/ksh*
-rwxr-xr-x  1 root       241664 May 23  1990 /usr/bin/csh*
-rwxr-xr-x  1 root        45056 Apr  1  1990 /bin/sh*
-- 
	--Per Bothner
bothner@cs.wisc.edu Computer Sciences Dept, U. of Wisconsin-Madison

chet@odin.INS.CWRU.Edu (Chet Ramey) (01/11/91)

In article <1991Jan10.183056.20614@spool.cs.wisc.edu> bothner@sevenlayer.cs.wisc.edu (Per Bothner) writes:

>> = Michael D Mellinger
> = Per Bothner

>>I found BASH 1.05 to be very unstable.
>
>I haven't. Very infrequently (less than once a month),
>I've noticed it freeze up on me, but generally I have no problems.
>
>>I wouldn't use it as my login shell.
>
>I do on my home Sony (68020, bsd 4.3-based), on my friend's
>DECstation3100, and I use it as my main shell (though I haven't
>updated /etc/passwd) on my office DEC3100.

I can't let an opportunity like this go by :-)

(CWRU bash is what is described in the manual page, available for anon
ftp from ftp.cwru.edu (aka cwns2.ins.cwru.edu, 129.22.8.44) in the
directory pub/bash.  Differences from the distributed versions of bash
are in the file CWRU-differences in the same directory.)

Everyone in my department uses CWRU bash as his login shell, and I have 
given it to a number of other departments here, where it is also in daily
use as a login shell.  It has been my login shell since version 0.93.
(Of course, I fix all the problems I find myself.)

It runs as /bin/sh on my home machine (an IBM RT running 4.3 BSD) and on
a pool of RTs here at work.  Again, few or no complaints.  A couple of
people here are writing large shell applications using it -- it's far more
capable than the BSD sh.

>Version 1.06 is long overdue...

Agreed.

>tcsh is ok, but it is a bit of a kludge, and it requires csh
>source. Also, I would advise against writing major macros
>or programs using [t]csh, given that the Posix standard
>(and ksh and bash) are based on Bourne shell syntax.

CWRU Bash is an implementation of the Posix.2 shell spec, as of
draft 9 (and bits of draft 10).  It also includes most of the
Posix.2a spec, as of draft 5.

(I'd advise against writing csh applications anyway; the parser is
flakier than a bowl of cereal.)

>>BTW:  The BASH binary(like most GNU binaries) is quite large.

It was not `written small' like sh.  It actually uses the C library.
It does not have some of the built-in size limits of sh.  The line
editing code takes up a tremendous amount of space.

Chet
-- 
Chet Ramey				``There's just no surf in
Network Services Group			  Cleveland, U.S.A. ...''
Case Western Reserve University
chet@ins.CWRU.Edu		My opinions are just those, and mine alone.

tchrist@convex.COM (Tom Christiansen) (01/11/91)

From the keyboard of chet@po.CWRU.Edu:
:It was not `written small' like sh.  It actually uses the C library.
:It does not have some of the built-in size limits of sh.  The line
:editing code takes up a tremendous amount of space.

Plus, last time I checked, the vi mode was vastly inferior to ksh's.
I know I should go play with it more so I can supply precise 
objections to the developers, who've always seemed quite amenable
to input.  Someday...

--tom
--
"Hey, did you hear Stallman has replaced /vmunix with /vmunix.el?  Now
 he can finally have the whole O/S built-in to his editor like he
 always wanted!" --me (Tom Christiansen <tchrist@convex.com>)

fischer@iesd.auc.dk (Lars P. Fischer) (01/11/91)

>>>>> On 9 Jan 91 21:37:26 GMT, melling@cs.psu.edu (Michael D Mellinger) said:

Michael> I found BASH 1.05 to be very unstable.  I wouldn't use it as my login
Michael> shell.

I have used bash as my login shell for more than a year now and loved
it all the way. True, it has crashed a few times, but not nearly
enough to be of any concern -- the advantages of bash outweighs the
cost in a big way.

Michael> For now though, I recommend tcsh.

I just changed site and I haven't got bash set up yet, so I've been
using tcsh for a few days now, and it driving me nuts. No searching,
no undo, no piping out of for-loops ... YUCK.

I wouldn't recommend bash as a login shell for naive (non UNIX
literate) users, yet. For me its the best there is.

/Lars
--
Lars Fischer,  fischer@iesd.auc.dk   | Q: How does a project get to be one 
CS Dept., Univ. of Aalborg, DENMARK. | year late?     A: One day at a time.

mday@iconsys.icon.com (Matt Day) (01/12/91)

In article <1991Jan10.183056.20614@spool.cs.wisc.edu> bothner@sevenlayer.cs.wisc.edu (Per Bothner) writes:
>tcsh is ok, but it is a bit of a kludge, and it requires csh
>source. Also, I would advise against writing major macros
>or programs using [t]csh, given that the Posix standard
>(and ksh and bash) are based on Bourne shell syntax.

There are plans to rewrite the parts of the csh that under AT&T Copyright,
so the csh and the tcsh could be freely distributed under the Berkeley
copyright.  It is true, that the Bourne shell is the standard, but I would
only recommend writing Bourne shell scripts if you need to be portable to
stupid systems that don't have csh.  For your personal day-to-day shell
activity, I find the tcsh a much better choice than the Bourne shell
variants.
-- 
- Matt Day, Sanyo/Icon, mday@iconsys.icon.com || uunet!iconsys!mday

jsparkes@bwdls49.bnr.ca (Jeff Sparkes) (01/12/91)

In <1991Jan10.235258.17202@convex.com> tchrist@convex.COM (Tom Christiansen) writes:

>From the keyboard of chet@po.CWRU.Edu:
>:It was not `written small' like sh.  It actually uses the C library.
>:It does not have some of the built-in size limits of sh.  The line
>:editing code takes up a tremendous amount of space.

>Plus, last time I checked, the vi mode was vastly inferior to ksh's.
>I know I should go play with it more so I can supply precise 
>objections to the developers, who've always seemed quite amenable
>to input.  Someday...

I'm the main author of the vi mode stuff, but I haven't done much lately.  I
have a fairly complete vi emulation done (the only thing I haven't done is
implement ".", which is a royal pain in the current setup), and have mailed
it off to Brian Fox several times.  Of course, it's been so long since
version 1.05 that I've practically given up doing anymore work on it because
any diffs I produce will probably be pretty hard to apply to the core
readline.c code.  Besides, the emacs bigots always give us vi types a lot of
grief.  Look at some of the comments they've put into bash.

By the way, I do use bash as my login shell.  I used to work on and use the
pd-ksh written by Eric Gisin, but gave up after being unable to communicate
with him for a long period of time.  I didn't feel right about distributing
a modified version without his support.  At least with bash my work is going
towards an evolving product.  Or it used to; who knows anymore.
--
Jeff Sparkes jsparkes@bnr.ca	Bell-Northern Research, Ottawa (613)765-2503
Another feature is that the seats float, so that the airline can recover
them if the plane crashes into the ocean. -- Dave Barry

cudcv@warwick.ac.uk (Rob McMahon) (01/15/91)

In article <1991Jan9.140124.22689@odin.diku.dk> kimcm@diku.dk (Kim Christian Madsen) writes:
>>Pros/Cons vs. TCSH
>
>+Has emacs like i-search and reverse-i-search.
>
>This is a great help, for finding old commands in just a few strokes, instead
>of C-p-C-p-C-p ad nauseam.

But note that tcsh has ESC-p to search for previous commands that began with a
certain string, which is usually all you need.  Also I find tcsh's ESC-s for
spell-word, ESC-$ for spell-line, and `set correct = all' for automatic
typo correction invaluable.

I have tried bash out a bit, but it was too flakey at 1.05 for me to use.  A
beta version of 1.06 was around for a bit and seemed much better, but was
branded unofficial.  The problem with bash is that the bash newsgroup/mailing
list is full of `I have problem X' ... `S'OK, that was fixed 6 months ago',
which gets very frustrating.  Where are these fixes ?

I'm sure bash is great for Brian and Chet, and one of these years might be
good for the rest of us, but for now I'll stick to tcsh.

Rob
--
UUCP:   ...!mcsun!ukc!warwick!cudcv	PHONE:  +44 203 523037
JANET:  cudcv@uk.ac.warwick             INET:   cudcv@warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England