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.

Ali_d
  • 101
  • 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` – Valentin Bajrami Feb 17 '22 at 08: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? – Ali_d Feb 17 '22 at 08:37
  • 2
    See here: https://unix.stackexchange.com/questions/611694/creating-a-shell-script-version-of-terminal-commands – pLumo Feb 17 '22 at 08:57

0 Answers0