Slurm is workload manager. There are two kinds of modes to run job, interactive(srun) and batch mode(sbatch).

When using interactive mode, one needs to leave the terminal open which may lead extra burden to the remote terminal(laptop).

However, sbatch mode just submit the bash script(*.sh) and can close the remote terminal. All the following steps are handled by the computing nodes.

When I run the executable program, it prompts "Are all filenames correct?" and expects "yes". What I want is that the script to automatically input "yes" for this prompt when running *.sh file so that the program can continue without interaction.

If you need any further clarification, please let me know.

closed as unclear what you're asking by Anthon, Rui F Ribeiro, roaima, xhienne, dhag Aug 24 '17 at 18:36

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    What are you running? Many programs have a flag for this, like -y, but if you don't tell us what program you run, we cannot help. – pfnuesel Aug 24 '17 at 15:06
  • 1
    Some programs can take the input from standard input. Try piping the output of yes yes to it... That's the yes utility executed with yes as its only argument. – Kusalananda Aug 24 '17 at 15:08
  • 1
    You may have to use an expect script – Raman Sailopal Aug 24 '17 at 15:21
  • Thanks for your kind help. I'm running FEM code and the following answer does solve my issue. – Rilin Shen Aug 24 '17 at 18:25
echo yes | your-program
yes yes  | your-program
  • Thanks very much, It really works. I test and find something differences between these two commands. It seems echo yes | program can end the program immediately and correctly after it was run, whereas yes yes | program cannot. Could you please give me details on this issue? – Rilin Shen Aug 24 '17 at 18:21
  • The first will send one "yes"; the second sends as many as your program will read. – Jeff Schaller Aug 24 '17 at 19:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.