LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-28-2005, 04:29 AM   #1
hinetvenkat
Member
 
Registered: Nov 2004
Location: Mumbai
Posts: 80

Rep: Reputation: 15
Sed & Awk


Hello All

Kindly tell me.. sed and awk command requires macros for advanced processing. If it is there, how to use that.

Kindly help me.

Thanks
 
Old 05-28-2005, 04:48 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Maybe I misunderstand, but I've never used macro's (didn't know they excisted) in all the years I use sed/awk.

Can you be a bit more elaborate about what it is you heard/read.
 
Old 05-28-2005, 06:29 AM   #3
hinetvenkat
Member
 
Registered: Nov 2004
Location: Mumbai
Posts: 80

Original Poster
Rep: Reputation: 15
please follow sed & awk command book -- oreilly ( page 73 )

example is to create the index page. for that they use macros like

Chapter title (.Se)
Section heading (.Ah)
Subsection heading (.Bh)


sed command is like
sed -n '
s/^\.Se /CHAPTER /p
s/^\.Ah / A. /p
s/^\.Bh / B. /p' $*

Thanks
 
Old 05-28-2005, 06:55 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi again,

Thanks for the sepcification, makes life easier

The reference to macro's have nothing to do with grep/sed (as stated on page 70, bottom paragraph). The macro file they are talking about (/usr/lib/macros/mmt) comes with troff (page 71, top) and is used in the getmac script.

These (troff) macro files migth not be installed on your box.

Hope this clears things up a bit.
 
Old 05-30-2005, 05:10 AM   #5
hinetvenkat
Member
 
Registered: Nov 2004
Location: Mumbai
Posts: 80

Original Poster
Rep: Reputation: 15
Hi
Ok Thanks a lot for your information. Now It is working.

Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sed/awk for matching & substituition laikos Programming 3 11-22-2006 11:44 AM
awk and sed issues alaios Linux - General 11 03-24-2005 05:33 AM
awk/sed help pantera Programming 1 05-13-2004 11:59 PM
Tutorial on sed & awk LinuxTiro Programming 4 11-10-2003 03:53 AM
sed/awk problem player_2 Programming 9 08-26-2003 06:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration