Skip to main content
Post Undeleted by xenoid
added 11 characters in body
Source Link
xenoid
  • 9.3k
  • 4
  • 29
  • 52

As coded your function makes you script exit before it returns. Just removeThis is because $(crash) executes crash in a subshell, so the exit fromapplies to the function bodysubshell and not to your script.

What is the point of capturing the output in a variable if you won't use it because the script exited anyway?

As coded your function makes you script exit before it returns. Just remove the exit from the function body.

This is because $(crash) executes crash in a subshell, so the exit applies to the subshell and not to your script.

What is the point of capturing the output in a variable if you won't use it because the script exited anyway?

Post Deleted by xenoid
Source Link
xenoid
  • 9.3k
  • 4
  • 29
  • 52

As coded your function makes you script exit before it returns. Just remove the exit from the function body.