Operating System - HP-UX
1826415 Members
3853 Online
109692 Solutions
New Discussion

Re: AWK & SED Complete Reference

 
SOLVED
Go to solution
Ranjith_5
Honored Contributor

AWK & SED Complete Reference

Hi Friends,

I am searching for a complete reference for AWK and SED. I tried a lot in www.google.com and ITRC forums as well. But all I got was only very brief docs and tips.

Anyone can help me in finding an elaborated documentation with a link for the same or share any docs? Sure you are going to get full PTS if the doc covers my area of interests.

Thanks in advance.
Regards,
Syam
22 REPLIES 22
Muthukumar_5
Honored Contributor

Re: AWK & SED Complete Reference

Use the followings,

http://www.tldp.org/LDP/abs/html/sedawk.html

http://www.geocities.com/kmuthu_gct/sed_awk_tips.html

http://builder.com.com/5100-6372_14-1050917.html

More read awk,sed man page word by word.

HTH.
Easy to suggest when don't know about the problem!
Ranjith_5
Honored Contributor

Re: AWK & SED Complete Reference

Muthu Anna,

I have already gone through, such tips. I need a document in detail about the same. I will need to write a some complicated scripts some times. So I am planning to learn in deep. So any docs available with you?

regards,
Syam
Hein van den Heuvel
Honored Contributor

Re: AWK & SED Complete Reference

Don't do it!
Do yourself a favor and learn PERL instead!



2c

Hein.
Ranjith_5
Honored Contributor

Re: AWK & SED Complete Reference

Hein,

I dont have a strong programming background. I rate myself as a beginner in programming. So can I start with Perl?

regards,
Syam
Stefan Schulz
Honored Contributor

Re: AWK & SED Complete Reference

Hi,

the awk language was written by Aho, Weinberger and Kernighan. They also wrote a good book about it.

If you search amazon you will find this book:

http://www.amazon.com/exec/obidos/tg/detail/-/020107981X/qid=1106291867/sr=1-6/ref=sr_1_6/104-1131083-0285552?v=glance&s=books

Some years ago i used a older version of this book and it helped me a lot.

But if you need more then field orientated (awk) and line orientated (sed) programming. Then i would go for pearl, which can everything sed and awk can do and a lot more.

Regards

Stefan
No Mouse found. System halted. Press Mousebutton to continue.
Ravi_8
Honored Contributor

Re: AWK & SED Complete Reference

Hi

refer some unix shell programming books,
never give up
Ranjith_5
Honored Contributor

Re: AWK & SED Complete Reference

Friends,

I managed myself to find out lot of free reference in the following place.

http://web.info.com/_1_OEETYD02NSSEFF__infocom.us2/search/web/Awk%2BManual/1/15/1/-/1/0/1/1/1/1?&cmp=1597&tpxnws=1

Now I am searching for SED.


regards,
Syam
Thierry Poels_1
Honored Contributor

Re: AWK & SED Complete Reference

Hi,

I agree with Hein: go for Perl.

But on Unix you definitely need some basic skills of AWK & SED. Don't worry about SED, if you know VI, then you know probably enough about SED.

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Ranjith_5
Honored Contributor

Re: AWK & SED Complete Reference

Can anyone get me online manuals/PDFs of SED?

regards,
Syam
H.Merijn Brand (procura
Honored Contributor

Re: AWK & SED Complete Reference

May I add one HUGE advantage of learning Perl?

ONLINE DOCUMENTATION

sed and awk are great, for what they're created for. They're old and rusty, and don't allow more complex stuff to be written *and* maintained easily. (yes, they allow complex stuff, but don't try to maintain 400 line sed or awk scripts)

perl comes with the *complete* documentation online (source of the docs is 4.5 Mb!), in whatever form you prefer: man, pod, html, ... and had converters for the man pages and utilities to be even more efficient: forgot how sysseek works?

# perldoc -f sysseek

Forgot the options to start perl with?

# man perlrun

Want a tutorial about perl regular expressions?

# man perlretut

etc, etc. All of that not available for awk and sed.

I still use awk and sed, but once I want to glue, filter, join, combine, or distribute data(bases) I use perl. Perl also has CPAN: Comprehensive Perl Archive Network, an enourmous repository of plug-in modules that allow you to you perfect solutions from others and don't have you reinvent a wheel. Most wheels are already invented.

Perl also gives two scripts (a2p and s2p) that convert valid awk (a2p) and sed (s2p) to perl, so if you can read/maintain perl, and you do not understand a legacy piece of awk, just run it through a2p, read the perl code and understand what the awk script was supposed to do

For all three languages, I recommend to read Jeffrey Friedl's "Mastering Regular Expressions", which covers all available regular expressions currently used in the unix world: awk, sed, grep, perl, python, vi, emacs, java, .net, posix, ... ( http://regex.info/ )

Books:
awk: http://www.oreilly.com/catalog/awkprog3/index.html
awk & sed: http://www.oreilly.com/catalog/sed2/index.html
perl: http://www.oreilly.com/catalog/pperl3/
regex: http://www.oreilly.com/catalog/regex2/index.html

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Thierry Poels_1
Honored Contributor
Solution

Re: AWK & SED Complete Reference

hi,

found this one but have no idea how legal this page is:

http://www.hk8.org/old_web/

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Ranjith_5
Honored Contributor

Re: AWK & SED Complete Reference

Poels,

I already got a Complete PDF of AWK from http://www.cs.uu.nl/~piet/docs/nawk/

But still you did a great help for me. I had gone through this link 2-3 years back when I tried to find out books on html. But When I tried today for scripting I cudn't.

Procura,

You were also in the right track but Your First links on regular expressions are not in english language.

other links you mentioned are giving only previews.

Any way thanks for all your helps.

regards,
Syam
H.Merijn Brand (procura
Honored Contributor

Re: AWK & SED Complete Reference

The first link *does* have an english link: upper right corner.

This is about *books* though, and Mastering Regular Expressions is a book I indeed highly recommend as a BOOK. The other books I mentions are easily replaced with on-line references.

This Friedl book however, you will probably use as a reference in which you want to read, re-read, and re-re-read paragraphs to fully understand the content, and for that I prefer a dead-tree version

Enjoy, Have FUN! H.Merijn [ A complete Perl addict ]
Enjoy, Have FUN! H.Merijn
Fred Martin_1
Valued Contributor

Re: AWK & SED Complete Reference

For AWK you really need "The AWK Programming Language" by Aho, Kernighan and Weinberger ... The book is a 200-page paperback and is one of the best technical manuals ever written. All you need to know, but nothing else.
Fred
fmartin@applicatorssales.com
Joseph A Benaiah_1
Regular Advisor

Re: AWK & SED Complete Reference

Syam,

I have probably given the same advice to people over the years who are looking for a complete reference to Sed and AWK. In my opinion, the Oreilly Sed and AWK book is still the best reference for System Programmers. It covers all areas of sed and awk with very good and well documented examples. All the examples listed in the book can be downloaded from the Oreilly ftp server.

Cheers,

Joseph
jsung7
New Member

Re: AWK & SED Complete Reference

Syam

Your thread is very inspiring. Since you are looking for resources for sed. You may have already found good links. I came across the following sed link: FYI

http://en.wikipedia.org/wiki/Sed

Very informative and resourceful.
Ranjith_5
Honored Contributor

Re: AWK & SED Complete Reference

Joseph,

Thanks for your reply.

As I have mentioned in my last reply, I already got resources for awk..Looking for sed complete reference. All I am getting is bits and bytes...No complete docs I am getting.

Jsung,

Thank you..But your post also a one page document. As you know SED is very vast..Looking for a detailed documentation.


regards,
Syam
jsung7
New Member

Re: AWK & SED Complete Reference

Hi Syam,

Did you try External Links on that link?
e.g.
Major sources for sed scripts, files, usage (http://sed.sourceforge.net)
The sed FAQ (http://sed.sourceforge.net/sedfaq.html)
Handy one-line sed scripts (http://sed.sourceforge.net/sed1line.txt)
A home page for sed, some focus on Windows/DOS (http://www.pement.org/sed/)
Paper describing Turing machine in sed, and its universality (http://sed.sourceforge.net/grabbag/scripts/turing.txt)
Turing machine in sed, the actual script (http://sed.sourceforge.net/grabbag/scripts/turing.sed)
Super-sed (http://www.gnu.org/directory/text/editors/super-sed.html)
sed Sokoban (http://aurelio.net/sed/sokoban/)

Indeed these pages are links to links. They are great sed links, but you may have gone through most of them.

By the way, while searching for good learning resources for python, I found this link on amazon book reviews:

"Dive into Python" by Mark Pilgrim
can be downloaded from the following web site: diveintopython.org

Ranjith_5
Honored Contributor

Re: AWK & SED Complete Reference

Hi jsung,

I wonder why none of the above mentioned is showing.."This page cannot be displayed"..

None are working..!!

Regards,
Syam
jsung7
New Member

Re: AWK & SED Complete Reference

Hi Syam,

Sorry for the confusion.

I tried and found that the "page not found" error is caused by the close (right) parenthesis which follows each URL.

You mentinoed you are looking for more than just one-liner sed document. I checked each link. These links are great sed links but they are probably for beginner to intermediate level users.

Before you find better documentation, give it a shot.
jsung7
New Member

Re: AWK & SED Complete Reference

Hi Syam,

Actually, I found this link should be one of the doors to the whole Internet resources for sed.

http://en.wikipedia.org/wiki/Sed

It is not just a one-page tips & tricks. Have fun.

jsung7
Ranjith_5
Honored Contributor

Re: AWK & SED Complete Reference

Jsung..,

You have done it ..!!!
Thanks a lot.

Thanks to all who responded.
Closing the thread.

Regards,
Syam