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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:03:15+00:00 2026-05-31T20:03:15+00:00

Right now I have some troubles. I’m finding a way to solve one problem.

  • 0

Right now I have some troubles. I’m finding a way to solve one problem. I have some file in the tree whose names are stdout-captured, stderr-captured and status-capture and I have to rename these files to stdout-expected, stderr-expected and status-expected.
Thanks for your help.

  • 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-31T20:03:16+00:00Added an answer on May 31, 2026 at 8:03 pm

    From what we can discern of this question, you’re attempting to create a programmatic rule to rename files ending in extensions stdout-captured, stderr-captured, and status-captured (assuming one typo) into files ending in extensions stdout-expected, stderr-expected, and status-expected, respectively. Obviously, if each of these definitions is inclusive of exactly one file, a rote mv may be more appropriate.

    To perform the translation you desire with sed, simply invoke the following in /bin/bash with the desired target as your current working directory:

    EXTENSION=stdout-captured
    REPLACEMENT=stdout-expected
    for arg in $(ls *.$EXTENSION); \
      do mv $arg $(echo $arg | sed s/\\.$EXTENSION/.$REPLACEMENT/); \
      done
    

    … where $EXTENSION and $REPLACEMENT are defined for each of the cases that you wish to detect and replace for. This assumes no files contain .$EXTENSION anywhere in the remainder of the filename. awk is unnecessary for this solution.

    For invoking this recursively across multiple directories, consider replacing ls with find and updating the rule accordingly. Note that find has its own facilities to perform operations on found resources, as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some trouble finding the right design solution for a problem of sharing
I have some code right now that executes when a link is clicked. The
Hey right now I'm using jQuery and I have some global variables to hold
Right now I have a JSP page that allows to sort some items, when
I have created some tests in my WPF application. Right now I am working
I have some troubles to find the right loop to check if some values
Right now, I have two TextView 's. One is aligned to the left of
I'm having some trouble with MySql right now. I have an query that works
Good day! I right now have a function the drags an element from a
Right now I have a database (about 2-3 GB) in PostgreSQL, which serves as

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.