LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Sed & Awk (https://www.linuxquestions.org/questions/linux-software-2/sed-and-awk-327909/)

hinetvenkat 05-28-2005 04:29 AM

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

druuna 05-28-2005 04:48 AM

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.

hinetvenkat 05-28-2005 06:29 AM

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

druuna 05-28-2005 06:55 AM

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.

hinetvenkat 05-30-2005 05:10 AM

Hi
Ok Thanks a lot for your information. Now It is working.

Thanks


All times are GMT -5. The time now is 08:22 PM.