First command may fail, the second command should run #2536
Answered
by
manuelesimi
manuelesimi
asked this question in
Q&A
-
Could I please have some help with a workaround from someone who is more experienced with bash and Nextflow? I have a process that has two commands, one that can fail and another that should run even if the first fails. The above trap implementation exits before the second command so I need something that can suppress or change the exit code like so process foo {
'''
trap 'if [[ $? == expected_error ]]; then echo "OK supreesed error"; fi' EXIT
your_command_that_may_fail
second_command
'''
} Originally posted by @NickSwainston in #1564 (comment) |
Beta Was this translation helpful? Give feedback.
Answered by
manuelesimi
Jan 5, 2022
Replies: 1 comment 1 reply
-
This should do it:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
manuelesimi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@NickSwainston
This should do it: