If A is true, then do B, or C in the case of an error (notice that C may run even if A fails)

test

  • Check file types and compare values.
    Returns 0 if the condition evaluates to true, 1 if it evaluates to false.
    More information: <https://www.gnu.org/software/coreutils/test>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

test {{condition}} && {{echo "true"}} || {{echo "false"}}

click the source code to copy install test on any operating system with command-not-found.com