# Shell Script Required? Pls. help me

**URL:** <https://community.unix.com/t/shell-script-required-pls-help-me/198780>\
**Category:** Shell Programming and Scripting\
**Created:** [May 28, 2008, 10:01am UTC](https://community.unix.com/t/shell-script-required-pls-help-me/198780 "2008-05-28T10:01:01Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![ripat](https://community.unix.com/letter_avatar/ripat/32/5_5575768a8748004e209b776fc1b2916d.png) [@ripat](https://community.unix.com/u/ripat)\
**Post date:** [May 29, 2008, 6:57am UTC](https://community.unix.com/t/shell-script-required-pls-help-me/198780/21 "2008-05-29T06:57:15Z")

</div>

The third element of the match() function is a GNU awk extension. How about this:

```nohighlight
#!/bin/bash 
awk '
BEGIN {RS="\++ NMInterface";OFS=FS="\n";ORS="\n\n"}
{print $4,$9,substr($0, match($0, /IfName:/), 18)}
' your.file

```

---

<div class="post-metadata">

**Author:** ![ntgobinath](https://community.unix.com/letter_avatar/ntgobinath/32/5_5575768a8748004e209b776fc1b2916d.png) [@ntgobinath](https://community.unix.com/u/ntgobinath)\
**Post date:** [May 29, 2008, 7:04am UTC](https://community.unix.com/t/shell-script-required-pls-help-me/198780/22 "2008-05-29T07:04:07Z")

</div>

Ripat,

I'm disturbing you so much. Here is the result.

# ./int  
Memory fault(coredump)

Thanks,  
Gobinathan.S

---

<div class="post-metadata">

**Author:** ![ripat](https://community.unix.com/letter_avatar/ripat/32/5_5575768a8748004e209b776fc1b2916d.png) [@ripat](https://community.unix.com/u/ripat)\
**Post date:** [May 29, 2008, 7:09am UTC](https://community.unix.com/t/shell-script-required-pls-help-me/198780/23 "2008-05-29T07:09:11Z")

</div>

Well, I am sorry ntgobinath but I only have GNU Linux boxes to test your problem. May be someone with an HP-UX machine will jump in. But no doubt awk is the way to go, especially if you have a large file to process.

[Previous page](https://community.unix.com/t/shell-script-required-pls-help-me/198780.md?page=1)
