From what I understand, the program is asking you to type those parameters, because it won't read them as command line arguments. If that is the case, you could try to read from a file (but there's a better option!) like this in your script.sh:
#!/bin/bash
simulationProgram < fileWithArguments.txt
The file "fileWithArguments.txt" should have every argument the program is asking you to type, one per line and in the order the program asks them.
About the better way? Use a heredoc, it's like putting a file inside a file:
#!/bin/bash
simulationProgram << EOF
argument1
...
lastArgument
EOF
anotherCommands # If you need them
The EOF tells bash where the here-doc ends, you can use any word, but be sure that the one after << and at the end of the arguments are the same. You can also use bash variables inside the here-doc.
EDIT: I wasn't as clear as I should have been. The heredoc should go in the script with the loop, not in the bash call. Here is what your script should look like, assuming it only asks for 1.24 and 1 each time you run the program (note that 1.24 and 1 are in different lines):
#!/bin/bash
name="Na"
for j in {1..3}
do
mkdir $j
cd $j
../../../../../abcinp "$name$j" 1 LennardJones 5.0 30 300 5 30 $j Na << EOF
1.24
1
EOF
cd ../
done
echo "All done"
What happens inside:
- The name variable gets initialized.
- The loop starts, j is 1.
- You create the dir $j (so it will be called "1")
- You go to that directory.
- You launch abcinp, which I assume calculates a molecular parameter or something (this physics program all have the annoying habit of asking for manual input), with a series of arguments.
- abcinp launchs, and asks for manual input.
- Bash answers the manual input with the first line after "EOF": 1.24.
- Bash does the same the second time asks for manual input, with the second line (so it will answer 1).
- Then the program stops asking for parameters and starts calculating. When it finish, you move to the parent directory and start with the next iteration of the loop. After all of them are done, echo will print "All done".
Note: I'm assuming abcinp asks for a parameter, then you press enter, and then asks for another one. If you literally have to type "1.24 1" in the same line, they should be in the same line in your script.
./simcode.shin a hoop itself? That way you would just call./simcode.sh 1.24 1each time it was needed. For a specific answer, you need to describe more fully how running script 1 results in./simcode.shbeing called X-number of times. That way, an answer can show you how to tie both scripts together.