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

  • Home
  • SEARCH
  • 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 7893257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:05:10+00:00 2026-06-03T07:05:10+00:00

I have this awk script: #!/usr/bin/awk -f BEGIN {IGNORECASE=1} /nVidia/ {inner=1;pci=$1} /(corr|fatal)err\-/ {if (inner)

  • 0

I have this awk script:

#!/usr/bin/awk -f
BEGIN {IGNORECASE=1} 
/nVidia/ {inner=1;pci=$1} 
/(corr|fatal)err\-/ {if (inner) print pci, $1, $2, $3, $4, $5, $6, $7} 
$0=="" {inner=0}

is there a syntax to always pipe sudo lspci -vvv to this script? I’m having to type sudo lspci -vvv|./checkpci each time I run the script. I know I could create a second script to launch the first script, but I think that is messy and would like to know the proper way to do so.

as an aside, I’m having some issues with my graphics card crashing and have seen the UncorrErr flag on some of the devices, does anyone have a reference as to what this means or how to troubleshoot further? right now I’m just going to run this script periodically to see when the errors show up in lspci to see if there is a time correlation.

  • 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-03T07:05:11+00:00Added an answer on June 3, 2026 at 7:05 am

    This should work for you:

    #!/usr/bin/awk -f
    BEGIN {
        IGNORECASE = 1
        cmd = "sudo lspci -vvv"
        while ((cmd | getline) > 0) {
            if ($0 ~ /nVidia/) {inner = 1; pci = $1} 
            if ($0 ~ /(corr|fatal)err\-/) {if (inner) print pci, $1, $2, $3, $4, $5, $6, $7} 
            if ($0 == "") {inner = 0}
        }
        close(cmd)
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this script #!/bin/bash function labels2 () { awk ' /[0-9]/{ print substr($3,length($3)-11),
I have the following script: #!/bin/bash STUB=`pwd | awk -F '/' '{print / $2
I have this script: #!/bin/bash CLASSPATH=/blah/libs/*:/blah/more/libs CMD=java -cp $CLASSPATH MainClass ALREADY_RUNNING_PID=`ps -ef --no-headers |
I have an associative array in awk that gets populated like this: chr_count[$3]++ When
I have an awk script that processes a csv file and produces a report
I have a shell script that constructs an awk program as a string then
I have this nifty little script that does a nice job of manipulating some
I have a small awk script that does some in-place file modifications (to a
I have this line samtools view -h file | awk '$3==chr$a || /^@/' |
How can I validate numeric input arguments to a tcsh script? #!/usr/bin/tcsh if (

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.