The following snakemake script:
rule all:
input:
\'test.done\'
rule pipe:
output:
\'test.done\'
shell:
\"\"\"
seq 1
A somehow clunky solution is to append || true
to the script. This will make the command always exit cleanly, which is not acceptable. To check whether the script actually succeded you can query the array variable ${PIPESTATUS[@]}
to ensure it contains the expected exit codes:
This script is ok:
seq 1 10000 | head | grep 1 > test.done || true
echo ${PIPESTATUS[@]}
141 0 0
This is not ok:
seq 1 10000 | head | FOOBAR > test.done || true
echo ${PIPESTATUS[@]}
0