Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Please edit your question and add more details. When you run multitool.sh -a a*.txt -b b*.txt, the shell will normally expand a*.txt to the list of the matching files. So for your script it looks like you ran multitool.sh -a a1.txt a2.txt -b b1.txt b2.txt Is this what you want? Or do you want to get the literal a*.txt in your script? Then you would need to quote the patterns in the command line. Commented Feb 24 at 13:26
  • @Bodo I want it to expand following the pattern Commented Feb 24 at 13:36
  • 1
    Do you really need to build your own? GNU parallel can do this, so can a combination of paste and xargs. I would urge you to ask a new question with the details of what you need to do because I really doubt rolling your own script will be the best solution here. Commented Feb 24 at 18:42
  • @terdon there's more to do in the script than just run a tool with paired inputs, and again I'm writing it from people who don't have much technical knowledge with the command line, so I'd rather write a script with some comments and help rather than a one-liner that someone could mess up during a copy+paste. My boss has a "pipeline" that's a bunch of bash commands written in a word document. Commented Feb 25 at 10:14
  • 1
    I get that, but that's precisely why I would think using standard tools and then writing a simple bash wrapper to call them would be easier. Absolutely nothing wrong with the answer you have though, so if that's enough for your needs, go for it. Commented Feb 25 at 14:12