-2

So, I am totally new to linux and while I searched for pretty long time, I couldn't find a solution for my problem. I know there is tee command and I should probably involve it but still I couldn't fully understand it.

Problem is: I have script.out file which processes files, it is as simple as that. I used to run it like that:

' ./script.out < inputfile > outputfile '

and it was OK but now I have about 200 files to process and I have no idea how to make it happen at once. I've renamed them to generic 'a01' - 'a80', 'b01' - 'b80' etc. and experimented a lot but couldn't find a way. It would be great if output files were named like 'a01mod' - 'a80mod' but really, I will be grateful for any applicable solution.

Thanks a lot!

0

1 Answer 1

0

You could run your script once for each file:

for file in a* b*; do
  ./script.out < $file > ${file}mod
done

(I assume every files starting with "a" or "b" in the current directory are input files)

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks man! Little problems there, but will sort out easily (initially I waited few minutes to realise it loops and modifies modified files :)).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.