Open topic with navigation

TIBCO GridServer® 7.1.0

# 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.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO GridServer®

Copyright © 2001-2022. TIBCO Software Inc. All Rights Reserved.