0

I have a very basic question. I want to run several files in my linux. Name of the files is input1.i, input2.i and so on. After running each input file, I should have an output for each of them. I tried the following method but it failed:

for file in input* do mpiexec -n 6 ./tiger-opt -i file.i # this line runs my inputs done 

the error is

Failed to get real path for file.i 

I very much appreciate if anyone can help me.

3
  • 5
    The -i file.i is taken verbatim. You need to expand your iteration variable like: mpiexec ..... -i "$file" You don't need to add the .i there since it is already taken from input Commented Feb 17, 2022 at 8:14
  • 1
    Dear @ValentinBajrami, your hint solved my problem. I did it with mpiexec -n 6 ./tiger-opt -i "$file". Do you know how I can make a bash file instead of a for loop? Commented Feb 17, 2022 at 8:37
  • 2
    See here: unix.stackexchange.com/questions/611694/… Commented Feb 17, 2022 at 8:57

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.