Shell input for parallel jobs


Let’s say you have a code that want its input from stdin

% cat charm.sh

#!/bin/bash

fn=`echo /dev/stdin`

cat $fn


and here is some test input:

% cat data
hello world


It is not possible to do

ibrun charm.sh < data

Instead, make a script that calls charm.sh:

% cat program.sh
#!/bin/bash

exec charm.sh < $1


and use it as

ibrun program.sh data

Some programs (for instance Quantum Espresso) can get their input also through a commandline option; see http://www.quantum-espresso.org/user_guide/node18.html