Skip to content
Ilya Sher edited this page Jul 24, 2025 · 4 revisions

This page list code comparisons between bash and Next Generation Shell, specifically ones that are longer in bash (or longer when implemented correctly as opposed to usually).

Note this is WIP.

exit_with_message

bash

In many scripts, we see something like this function:

exit_with_message () {
  echo $1 >&2
  exit 1
}

Specifically this snippet is from alexzautke/install-fhir-packages/install-fhir-packages.sh

NGS

In NGS, code that is very similar to exit_with_message is already in the standard library. Code like exit_with_message should never appear in your NGS script.

Use: exit("your own message")

Clone this wiki locally