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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:18:01+00:00 2026-06-02T12:18:01+00:00

In order to simplify my work I usually do this: for FILE in ./*.txt;

  • 0

In order to simplify my work I usually do this:

   for FILE in ./*.txt; 
   do ID=`echo ${FILE} | sed 's/^.*\///'`; 
   bin/Tool ${FILE} > ${ID}_output.txt; 
   done

Hence process loops over all *.txt files.

Now I have two file groups – my Tool uses two inputs (-a & -b). Is there any command to run Tool for every FILE_A over every FILE_B and name the output file as a combination of both them?

I imagine it should look like something like this:

  for  FILE_A in ./filesA/*.txt; 
  do for FILE_B in ./filesB/*.txt; 
  bin/Tool -a ${FILE_A} -b ${FILE_B} > output.txt; 
  done 

So the process would run number of *.txt in filesA over number of *.txt in filesB.
And also the naming issue which I even don’t know where to put in…

Hope it is clear what I am asking. Never had to do such task before and a command line would be really helpful.

Looking forward!

  • 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-02T12:18:10+00:00Added an answer on June 2, 2026 at 12:18 pm
    NEWNAME="${FILE_A##*/}_${FILE_B##*/}_output.txt"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In order to work with decimal data types, I have to do this with
In order to simplify the build process, I've been trying to reorganize my version
I am parsing some enum values from a text file. In order to simplify
Now I got a TabHost with several tabs, and in order to simplify the
so i have 4 divs (i actually have many more but this will simplify
I'm trying to simplify the deployment of an application. In order to build the
Is there a way to simplify this working code? This code gets for an
I have a node form in Drupal 7, in order to simplify it for
#!/usr/bin/python # # Description: I try to simplify the implementation of the thing below.
This program want to read from a file. the content in the file is

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.