Skip to main content
  1. Notes/

Bash

Specify a custom exit message and code for a command #

DIR='secret_directory'

cd "${DIR}" || {
    echo >&2 "Unable to access directory ${DIR}!"
    exit 2
}