Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7877317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:20:15+00:00 2026-06-03T03:20:15+00:00

I am using AIX and I have a string There is no process to

  • 0

I am using AIX and I have a string “There is no process to read data written to a pipe”. I want to get the output 2 lines before and 4 lines after this string.
The string is present like more than 100 times in the log and I want to output, the last result in the log with this string

I tried using :

nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r[(NR-c+1)%b];print;c=a}b{r[NR%b]=$0}' b=2   a=4 s="There is no process to read data written to a pipe" File.log

The output from this command is that I am getting all the 100 plus results where the above string is present

The -A number -B number command is not working in AIX

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:20:16+00:00Added an answer on June 3, 2026 at 3:20 am

    If you have GNU grep available, you can use it instead of awk:

    grep -B 2 -A 4 "There is no process to read data written to a pipe" File.log
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to compile Ruby 1.9.3-p125 on AIX 5.3 using xlc_r. I want to
I have been trying to compile netcat.c on AIX for some time (using the
I'm posting an XML string to a port on an AIX box. I have
I have a C application running on AIX 6.1 using Websphere MQ 6. The
I have been working on AIX and see some of the process ID's running
We have installed GDB on AIX 6.1 (gdb-6.0-1.aix5.1.ppc_AIX.rpm) and I notice that there is
I have client server application - client on C++ (running on AIX,using library ),
I'm using Perl sockets in AIX 5.3, Perl version 5.8.2 I have a server
I tried to compile the code using g++4.4.6 on aix 6.1. I dont have
I'm trying to build a simple c application using gcc on aix gcc -I.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.