Skip to content

Params unbound in Bash scripts #3187

@mbhall88

Description

@mbhall88

Snakemake version

This bug appeared in v5.25.1 (specifically, in eb11137). The minimal example below works in Snakemake v5.25.0

Describe the bug

When trying to access rule params in a Bash script, params are reported as unbound

Logs

/data/scratch/projects/punim2009/lrge/paper/tmp/smk_test/.snakemake/scripts/tmpatt_gm47.foo.sh: line 12: string: unbound variable

Minimal example

Snakefile

rule:
    output: "foo.txt"
    params:
        string="foo"
    script:
        "foo.sh"

foo.sh

#!/usr/bin/env bash
set -euo pipefail

echo "${snakemake_params[string]}" > "${snakemake_output[0]}"

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions