Skip to main content
Active reading [<https://en.wiktionary.org/wiki/Boolean#Noun>].
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 109
  • 132

Instead of faking a booleanBoolean and leaving a trap for future readers, why not just use a better value than true and false?

For example:

build_state=success
if something-horrible; then
  build_state=failed
fi

if [[ "$build_state" == success ]]; then
  echo go home,home; you are done
else
  echo your head is on fire,fire; run around in circles
fi

Instead of faking a boolean and leaving a trap for future readers, why not just use a better value than true and false?

For example:

build_state=success
if something-horrible; then
  build_state=failed
fi

if [[ "$build_state" == success ]]; then
  echo go home, you are done
else
  echo your head is on fire, run around in circles
fi

Instead of faking a Boolean and leaving a trap for future readers, why not just use a better value than true and false?

For example:

build_state=success
if something-horrible; then
  build_state=failed
fi

if [[ "$build_state" == success ]]; then
  echo go home; you are done
else
  echo your head is on fire; run around in circles
fi
Source Link
Pyrolistical
  • 27.9k
  • 21
  • 83
  • 109

Instead of faking a boolean and leaving a trap for future readers, why not just use a better value than true and false?

For example:

build_state=success
if something-horrible; then
  build_state=failed
fi

if [[ "$build_state" == success ]]; then
  echo go home, you are done
else
  echo your head is on fire, run around in circles
fi