time to start learning bash scripting

Rick Thomas yellowdog-general@lists.terrasoftsolutions.com
Wed Aug 27 14:12:01 2003


In the olden days, when I was a boy and before you were even a gleam in
your momma's eye (<-8) there was a sort of generally held philosophy
amongst UNIX programmers:  It was felt that the best way to solve a wide
variety of problems was to create a relatively few tools -- each one of
great generality but sufficiently limited scope that it could be
understood in its entirety in an afternoon (or at most a few days) of
study -- then put those tools together in a wide variety of ways to
solve problems.

It took great wisdom and some deep thought to decide exactly what the
minimal useful set of features were for a new tool, and it took equally
great restraint to implement that set of features and only that set. 
But it paid off.

This philosophy is at the root of UNIX reputation for having great
simplicity and great power.  It is also the reason us old geezers are
likely to groan and mutter "creeping featurism -- with a vengeance!"
when we read the latest release notes for things like Perl-x.y.z or MS-Word-3000.

That said, AWK, sed, and the Bourne shell -- from which the "bash" shell
is descended -- all date from that day and age.

Reading material -- all fairly short but equally dense:

The original paper describing UNIX by the people who invented it.
	"The UNIX Time-Sharing System"
	Dennis M. Richie and Ken Thompson 
	http://http.cs.berkeley.edu/~brewer/cs262/unix.pdf

The "AWK book" -- the definitive book about AWK by Aho, Weinberger, and
Kernighan -- the authors of AWK
	"The AWK Programming Language"
	Alfred V Aho, Brian W Kernighan, Peter J Weinberger
	Published by Addison Wesley

The man page for 'sed(1)' and 'sh(1)' in  the UNIX Seventh Edition
Manual (vol1, 2a, and 2b) available (thanks to Dennis Richie and Brian
Walden) in PDF on the web.  There are three PDF documents.  The sh(1)
and sed(1) man pages are included in "v7vol1.pdf"
	http://www.cs.bell-labs.com/7thEdMan/bswv7.html


Rick


Stefan Jeglinski wrote:
> 
> Hi All,
> 
> Thanks for the quick tips. This more than enough to get me started. I
> note that no one referred to awk, although perl cropped up. I suppose
> the problem is too easily solved without awk. Or is awk deprecated?
> 
> Something I don't get: perl is a self-contained scripting language,
> if you will. Am I correct in an observation that awk and sed seem to
> be more along the lines of a sophisticated command set that is used
> inside of [bash or perl] scripts, rather than separate languages?
> 
> Stefan Jeglinski