Command for extracting lines before and after a particular searched string pattern.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420
Original Poster
Rep:
Quote:
I read your first post VERY carefully, three times.
Is there some hidden meaning?
Maybe I am just not intelligent enough to understand your needs.
I apologize for wasting your time.
I know about the grep command daniel. But the thing is -C switch which you mentioned in your one of the posts do not support on my server. Also we're not authorized to upgrade the package to latest version.
That's why I'm here to get some help. And I'm not that much proficient in shell scripting, that's why I'm seeking some help from you guys.
And nothing is hidden.
I know you're intelligent buddy...
And no need to apologize buddy.. It's ok!
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420
Original Poster
Rep:
Hi druuna,
Quote:
- Did you copy paste it correctly (as a plain text file)?
- Which awk / awk version are you using (awk --version)
Yes I used the same script as mentioned by him.
And I used many methods which I know so far to check the version of awk, but none of them worked.
Can you please tell me how to check the version of awk on Solaris 10 ?
And I used many methods which I know so far to check the version of awk, but none of them worked.
Can you please tell me how to check the version of awk on Solaris 10 ?
This is the first time you mention using Solaris, which is rather important information.
Out of the box Solaris doesn't use GNU Awk. There is an alternative awk present you should use: /usr/xpg4/bin/awk
Try changing the following in grails code:
Code:
#!/usr/bin/awk -f
# change the above line to#!/usr/xpg4/bin/awk -f
Can I correctly assume you tried running awk --version to get the awk information?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.