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