Shell Directives in Heterogeneous Environments

It is the PDS script writer’s responsibility to declare a shell directive that is appropriate to the executing node’s platform. For jobs in heterogeneous environments, you can specify different directives within an if-then-else block. For example,

if $DSOS == "win32" then shell "cmd.exe" else shell "/bin/bash" end 

You can specify the argument “none”, in which case all following execute tasks spawn directly and not in a subshell.

It is also possible to use the bash shell with Windows by utilizing Cygwin, the UNIX environment for Windows.

To use bash and Cygwin on Windows machines:

1. Install Cygwin on another machine. You can get it at www.cygwin.com.
2. From the Cygwin installation, copy bash.exe and cygwin1.dll into the Engine’s path. This is either in a directory within the %PATH% on the Engine or the replication directory <engine_home>/resources/win32/bin. Also, copy any other Cygwin executables you use from the bash shell.
3. If bash is already in the path for the Engine, use the following syntax in the PDS script:
task
    shell "bash.exe"
    ...
end

or

task
    shell "none"
    execute stdout="outfile"
         "<optional_path>/bash.exe -c ""mycommand.exe"""
end

If the path to bash is not set, use the following syntax:

task
    shell "c:\cygwin\bin\bash"
    execute stdout="outfile" "echo hello"
end

The above example also requires that you copy the Cygwin echo.exe to the Engine.