Skip to main content
deleted 1 characters in body
Source Link
slm
  • 380.1k
  • 127
  • 793
  • 897

You must use

[[ statement ]] || { echo problem found ; exit 1; }

The difference is that the brace syntax doesn't screatecreate a subshell, which means the exit 1 applies to the current shell. If you use (exit 1) the subshell exits but the current shell continues running.

You must use

[[ statement ]] || { echo problem found ; exit 1; }

The difference is that the brace syntax doesn't screate a subshell, which means the exit 1 applies to the current shell. If you use (exit 1) the subshell exits but the current shell continues running.

You must use

[[ statement ]] || { echo problem found ; exit 1; }

The difference is that the brace syntax doesn't create a subshell, which means the exit 1 applies to the current shell. If you use (exit 1) the subshell exits but the current shell continues running.

Source Link
Kyle Jones
  • 15.4k
  • 4
  • 47
  • 53

You must use

[[ statement ]] || { echo problem found ; exit 1; }

The difference is that the brace syntax doesn't screate a subshell, which means the exit 1 applies to the current shell. If you use (exit 1) the subshell exits but the current shell continues running.