Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 2
    program I want to test definitely returns non-zero exit code - but what program are you testing here? Commented Feb 13, 2022 at 20:04
  • @ArkadiuszDrabczyk here I've added exit just to show that it returns bad exit code and still prints "OK". Originally, it looked like if echo "something" > ./mybinary; then Commented Feb 13, 2022 at 20:05
  • 3
    You're not exiting here but redirecting output of echo to a file called exit. Commented Feb 13, 2022 at 20:07
  • @ArkadiuszDrabczyk oh, I see, bash does exit as it should, the problem was that I passed the input incorrectly. Thanks! Commented Feb 13, 2022 at 20:09
  • Should I remove the question, or should I post that as an answer? Commented Feb 13, 2022 at 20:10