Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Aug 1997 01:07:06 -0600 (MDT)
From:      Wes Peters <softweyr@xmission.com>
To:        "Studded" <Studded@dal.net>
Cc:        questions@freebsd.org
Subject:   FreeBSD/Tcl success story (Re: Info on shells and script writing)
Message-ID:  <199708120707.BAA25167@obie.softweyr.ml.org>
In-Reply-To: <199708112306.QAA00849@mail.san.rr.com>
References:  <199708112306.QAA00849@mail.san.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Studded@dal.net writes:
 > 	I'm looking for a good book on the sh shell and writing scripts
 > with it.  Even better would be some good FAQ's and such available on the
 > net since "free" is much more in my price range nowadays. :)  
 > 
 > 	Alternatively, is sh "dead" in the modern Unix world?  I know Perl
 > and TCL are very popular, but I'm trying to produce some tools that will
 > be compatible across a number of platforms, and are easily
 > accesible/modifiable by people who are not professional system
 > administrators. 

I suspect both Perl and Tcl/Tk are more portable than shell scripts; My
Tcl/Tk book I bought a little while ago came with a CD-ROM with Tcl and
Tk for Windoze and Macintrash.  I, of course, choose to use Tcl on the
platform it was intended for -- FreeBSD.

My adventure into Tcl programming was simple -- I needed to write a
manufacturing acceptance test for my new baby, the Dayna Internet
Station dial-up router.  The MAT had to be able to do the following:

o Connect to the built-in command shell and issue several commands to
  format the embedded flash disk, clear the NVRAM, and set the clock,
  then reboot the system.

o FTP the initial system and configuration database to the system and
  reboot to get the full-featured FTP server up.

o FTP the full system, which is a single TAR ball containing the entire
  filesystem, and reboot.

o Connect to the configuration database and probe the three attached
  modems to make sure the serial port and PCCard controller are working.

o Ascertain the ethernet hardware address contains the proper vendor and
  product address ranges.

I did this in less than 5 hours, writing a Tcl script and a quick and
simple command-line driven ftp 'put' program using libftpio.  It is a
complete success.  It takes us about two and a half minutes to load the
code and test each iStation, plus I got to learn a new language.  The
manfucturing manager wants me to wrap it in a window, so in the next
month or so I'll get to learn Tk as well.  ;^)

 > 	Finally, for general purposes, what is the "best" shell available,
 > and why?  I know that this topic borders on religious fervor for some
 > people, but I'm at the point where I'm ready to pursue some
 > intermediate/advanced learning and before I put a lot of effort into
 > something that is never going to be the "best" I'd like some advice. 
 > Personally I'm happy with Bash for my everyday stuff, although from what
 > I've heard it's looked down on by the purists.  

I've been using bash for over 5 years now.  It's big, but we have
modern, efficient virtual memory systems, so who cares?  RAM is cheap.
Re-typing commands is stupid.  Plus, I've been hooked on interactive
recall since the first time I used it.  I even have bash for NT.  ;^0

-- 
          "Where am I, and what am I doing in this handbasket?"

Wes Peters                                                       Softweyr LLC
http://www.xmission.com/~softweyr                       softweyr@xmission.com






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708120707.BAA25167>