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 6684953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:59:59+00:00 2026-05-26T04:59:59+00:00

I am trying to add an || regex to a bash “ed one-liner in

  • 0

I am trying to add an || regex to a bash “ed one-liner in a perl script, if that makes any sense.

my $result = `df -H | grep -vE '^Filesystem|tmpfs|cdrom|none'  | awk '{ print \$1 "\t" \$5 " used."}'`; 

# .Private maybe the same as /dev/sdb1 so I'm trying to remove it too 
# by trying to add || (m/\.Private/) to the above

print  "$result";

So I am removing lines from the output that start with Filesystem, tmpfs, cdrom or none, at present, but I would also like to and the “or lines containing .Private” to the one-liner, if possible…

I have the below also, but want to reproduce its results with the above code…

my @result2 =Shell::df ("-H"); 
shift @result2;   # get rid of "Filesystem..."
for( @result2 ){
next if ((/^tmpfs|tmpfs|cdrom|none/) || (m/\.Private/));
my @words2 = split('\s+', $_);
print $words2[0], "\t", $words2[4], " used\.\n";
}
  • 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-05-26T04:59:59+00:00Added an answer on May 26, 2026 at 4:59 am

    You just need to add the \.Private part to the current regexp:

    grep -vE '^Filesystem|tmpfs|cdrom|none|\.Private'
    

    On a side note, the pattern ^Filesystem|tmpfs|cdrom|none might not actually do what you want, as only Filesystem is matched at the beginning of the line, the other parts will be matched if they appear anywhere in the input. To match them at the beginning, change it to:

    '^Filesystem|^tmpfs|^cdrom|^none'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add conditional logic to determine if there's one regex match for
I am trying to set the compilation-error-regexp-alist in a function that I add as
Trying to add a dynamic class value to one of my columns in CGridView:
Im trying to add a Jquery validation script to a form plugin for wordpress.
I'm trying to use regex to add a span to the first word of
I'm trying to use regex to parse some plain text and add a definition
I'm trying to write a Javascript regex that matches words with less than 3
I'm trying to create two a regex to add quotes to some values in
I am trying to write a regex that takes these examples: tbZipCode cbHavingLunch rfvAssessment
I'm trying to make a Regex that matches this string {Date HH:MM:ss}, but here's

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.