I have multiple files with names for instance
ahard.txt
asoft.txt
bhard.txt
bsoft.txt
chard.txt
csoft.txt
I want to loop over these files, but process them in groups, so that Xhard.txt
and aXsoft.txt
are used as input files, and X.txt
as output file, where the letter X
stands for a
, b
, c
etc. (it is actually a single letter in the filenames).
I have tried:
#!/bin/bash
i=$(ls *.txt)
for x in $i
do
pipeline nser=2 input1="${x/soft.txt}" input2="${x/hard.txt}" outfile="${x/hard.txt}"
done
?
do? – unicorn Nov 05 '21 at 09:10*
but it only matches a single character. – choroba Nov 05 '21 at 09:19