I think you want:

mpirun -np 6 ./laplace < HERE | tail -n 1 > output

You can add brackets to make it clearer:

((mpirun -np 6 ./laplace < HERE) | tail -n 1) > output

Hope this helps?

Benjie.


On 16 May 2011 17:35, Robin Wilson <ro...@rtwilson.com> wrote:

> Hi all,
>
> I have the following code in a batch script:
>
> mpirun -np 6 ./laplace <<END
> 100
> 100
> 100
> 0.01
> 100
> 3
> 2
> 1
> END
> | tail -n 1 > output
>
> What I want it to do is to use the HERE file as input to the mpirun
> command, and then pipe the output  of the mpirun command to the tail
> command. However, I think the HERE file and tail output things are getting
> confused.
>
> Any ideas on how should I write this so that it does what I want?
>
> Cheers,
>
> Robin
> --
> Please post to: Hampshire@mailman.lug.org.uk
> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
> LUG URL: http://www.hantslug.org.uk
> --------------------------------------------------------------
>
--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------

Reply via email to