Open MPI logo

MTT Devel Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all MTT Users mailing list

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2006-09-19 03:52:12


Ew. I believe that that is because &shell() is going to use sh/bash, not
csh, so the |& wouldn't work.

I also notice that /tmp/cc.out is not removed.

Can you just use sh syntax for grabbing stderr, something like:

compiler_version = &shell("cc -V 2>&1 | head -n 1 | nawk '{print \$4}'");

On 9/18/06 6:57 PM, "Ethan Mallove" <ethan.mallove_at_[hidden]> wrote:

> I finally got the &shell funclet to grab the Sun Studio compiler
> version. The below one worked from the shell, but not in the mtt
> client (because the cc -V output goes to stderr?).
>
> compiler_version = &shell("cc -V |& head -n 1 | nawk '{print \$4}'");
>
> The workaround was to have the 'cc -V' output and the head/nawk
> utilities rendezvous in a file instead of a pipe.
>
> compiler_version = &shell("cc -V 2> /tmp/cc.out; cat /tmp/cc.out | head -n 1 |
> nawk '{print \$4}'");
>
> -Ethan
> _______________________________________________
> mtt-users mailing list
> mtt-users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/mtt-users

-- 
Jeff Squyres
Server Virtualization Business Unit
Cisco Systems