In a message dated: Sun, 28 Jan 2001 12:41:37 EST
"Joshua S. Freeman" said:

>while we're on the subject, i was walking in the arnold arboretum this
>morning.. thinking about the linux professional institute
>certification.. i downloaded rute last night (a cert. manual..) from
>rute.sourceforge.net ... sed/awk are some of the first things covered
>and I thought it would be cool if there was a GUI frontend for sed and
>for awk.. if for no other reason to gain a better understanding of just
>what these two tools are for and how they are used...

Ahm, for "GUI" front-ends to sed/awk, you've got your choice between:

        emacs
        Xemacs
        vi
        vim
        gvim
        gnomepad
        gedit
        etc...

:)

sed and awk are pseudo-programming languages.  sed is the "Stream Editor".  
It's essentially a command line "search/replace" tool.  For example, the 
following will replace all instances of the string 'foo' with 'bar' in file
foobar and places the output in foobar.~1~:

        sed 's/foo/bar/g' foobar > foobar.~1~

Awk is a scripting language developed at Bell Labs.  It's name is derived from
the first letters of the 3 people who developed it; Aho, Weinberger, Kernighan.
Awk has largely been replaced by perl, but occasionally it still comes in 
quite useful.  For instance, if you need to quickly write a one line shell 
script which deletes files recently installed:

        rm `ls -lrt | grep 'Jan 29' | awk '{print $9}'`

or maybe kill a bunch of processes:

        kill -9 `ps -ef | grep foo | awk '{print $2}'`

There are countless other uses for both sed and awk, but for the most part,
anything that requires intensive use of either is usually more easily and more 
efficiently done in perl.

Awk (at least old versions) had an artificial line length limitation which 
prevented it from dealing with huge files which had lines > 1024 bytes.  It 
made dealing with things like postscript files with embedded images 
impractical.  Perl has no such limitations, however, the overhead of starting 
the perl interpreter can slow things down a little, which is why sed/awk still 
remain good tools to use from one-liners and small shell scripts.
-- 

Seeya,
Paul
----
        It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

         If you're not having fun, you're not doing it right!



**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to