time to start learning bash scripting

Geoffrey S. Mendelson yellowdog-general@lists.terrasoftsolutions.com
Wed Aug 27 06:53:01 2003


> 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?

AWK is a scripting language, sort of the grqandfather of perl.
I use awk mostly for one line commands as in

	<some command> | grep <get the right line> |awk 'reformat data' > file

or:

	ls *.mp3 |grep -i moody | awk '{print mpg123 -v $1} >playlist

Note that this will return a list of files that have moody in any 
combination of upper and lower case in any part of the file name.
"ls *[Mm][Oo][Oo][Dd][Yy]*" would do the same as the ls and grep with
a lot more typing.

Sed is a stream editor. It reads a streal (file/pipe) and makes changes.
It's an extension of ed. A more famous extension of ed is vi which is
a VIsual front end for ed.

Perl is a combination of awk, sed and whole lot of "boy I wish awk
had this in it". things.

Geoff.
-- 
Geoffrey S. Mendelson gsm@mendelson.com 972-54-608-069
Icq/AIM Uin: 2661079 MSN IM: geoffrey_mendelson@hotmail.com (Not for email)
Carp are bottom feeders, koi are too, and not surprisingly are ferrets.