The ShellTask flyte examples (<https://docs.flyte....
# ask-the-community
g
The ShellTask flyte examples (https://docs.flyte.org/projects/cookbook/en/v0.3.66/auto/core/flyte_basics/shell_task.html) describe them running "Bash scripts". However, it appears they are running under /bin/sh instead. How can I switch it to bash?
Copy code
t1 = ShellTask(
    name="task_1",
    debug=True,
    script="""
    set -ex
    set -o pipefail #Bash specific, and fails
    echo "Hey there! Let's run some bash scripts using Flyte's ShellTask."
    """,
    inputs=kwtypes(x=FlyteFile),
    output_locs=[
        OutputLocation(var="i", var_type=FlyteFile, location="{inputs.x}")
    ],
)
I get the following output from the web interface after the task tries to run: /bin/sh: 4: set: Illegal option -o pipefail
k
Can you make the first line #!/bin/bash
g
Thank you for the suggestion. I had the same idea, but it did not change anything.
s
i'm able to reproduce. created a PR to add
executable
to `ShellTask`: https://github.com/flyteorg/flytekit/pull/2084. that should let you set the type of the shell you need. you can just say
executable="/bin/bash"
and it should work.