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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:56:49+00:00 2026-05-14T08:56:49+00:00

I am trying to pull dynamics from a load that I run using bash.

  • 0

I am trying to pull dynamics from a load that I run using bash. I have gotten to a point where I get the string I want, now from this I want to pull certain information that can vary. The string that gets returned is as follows:

Records: 2910 Deleted: 0 Skipped: 0 Warnings: 0

Each of the number can and will vary in length, but the overall structure will remain the same. What I want to do is be able to get these numbers and load them into some bash variables ie:

RECORDS=??
DELETED=??
SKIPPED=??
WARNING=??

In regex I would do it like this:

Records: (\d*?) Deleted: (\d*?) Skipped (\d*?) Warnings (\d*?)

and use the 4 groups in my variables.

  • 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-14T08:56:49+00:00Added an answer on May 14, 2026 at 8:56 am

    You can use regex matching in Bash versions >= 3.2:

    [[ $line =~ ([[:digit:]]+).*([[:digit:]]+).*([[:digit:]]+).*([[:digit:]]+) ]]
    
    RECORDS=${BASH_REMATCH[1]}
    DELETED=${BASH_REMATCH[2]}
    SKIPPED=${BASH_REMATCH[3]}
    WARNING=${BASH_REMATCH[4]}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to pull some data from MySQL using an Array that was fetch
I am trying to pull an LDAP jpegPhoto attribute from an openLDAP server using
I'm trying to pull out information from a database with PHP and have the
I'm trying to pull first_name from Names table, but only if that users_id is
I am trying to pull data from our Oracle datamart into R using RODBC.
I am trying to pull from my heroku remote, I get this message: >git
I am trying to pull data from DBF files into my program using C#.
I'm trying to pull in images from Flickr using the phpFlickr library but the
I am trying to pull all tweets that include #multitouch from a single twitter.
I'm trying to pull from a List collection of comments in the View using

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.