Skip to content

How do you work with variables outsite of the try catch but changing its value inside? #92

Answered by niieani
felipegutierrez asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately, a try/catch block creates a subshell. In bash it's currently impossible to affect the parent shell from a subshells, so the only workaround I can think of would be to capture the try/catch stdout in a variable.

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by niieani
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #23 on March 01, 2021 06:10.