Scott,

Thanks. We'll test and push if it works on our end.

Cheers,

- Tom



On Nov 1, 2013, at 7:45 AM, Scott Wales <scott.wales@unimelb.edu.au> wrote:

Hi,

I'm taking a look at pfunit and ran into an error building it on Ubuntu along the lines of

    $ make tests
    ./tests/tests.x
    .....sh: 1: Syntax error: Bad fd number
    [similar errors follow]

The source of the error is in the UnixProcess module, where it is creating an external process with popen.

Ubuntu uses a pretty basic shell as /bin/sh, much closer to the original Bourne shell than Bash. The command to kill the external process is using a redirection syntax not supported by Bourne shell, though all the other commands are fine.

A patch to fix this is below, it changes the redirection syntax to match the other commands.

Cheers, Scott

$ git diff
diff --git a/source/UnixProcess.F90 b/source/UnixProcess.F90
index 32a03f0..5cdce99 100644
--- a/source/UnixProcess.F90
+++ b/source/UnixProcess.F90
@@ -109,7 +109,7 @@ contains
       integer :: stat, cstat
 
       if (this%pid >=0) then
-         write(command, '("kill -0 ",i0," >& /dev/null")') this%pid
+         write(command, '("kill -0 ",i0," > /dev/null 2>&1")') this%pid
          call execute_command_line(command, exitStat=stat, cmdStat=cstat)
          isActive = (stat == 0)
       else

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk_______________________________________________
Pfunit-support mailing list
Pfunit-support@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pfunit-support

Thomas Clune, Ph. D.  <Thomas.L.Clune@nasa.gov>
Chief, Software Systems Support Office Code 610.3
NASA GSFC 301-286-4635
MS 610.8 B33-C128 <http://ssso.gsfc.nasa.gov>
Greenbelt, MD 20771