Can't run simple commands

Hello, My apologies I can’t work it out.

docker run --rm -e DISPLAY= -u 1000:1000 -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/elm/OpenFOAM/elm-7:/home/openfoam -e XAUTHORITY=/home/openfoam/.Xauthority -v :/home/openfoam/.Xauthority openfoam/openfoam7-paraview56 ./mm

./mm has just some simple rubbish in it

echo ‘Bitme’ > ~/mm2.txt
gmshToFoam 2>&1 >> mm2.txt

If I run the image with -it I get the result I am expecting in mm2.txt (by typing in ./mm at the command prompt - not from the run command from the host).

./mm has 744 permission.

What am I doing wrong? Thanks. I just can’t seem to run a script from external to the image. It works fine from the image. I have searched all the manuals to no avail.

Tested on debian stretch and experoimental. Two versions of docker 19.03.5, build 633a0ea838 and a version 18.

Openfoam6 and Openfoam7. None work