With examples

File: with_examples.sh

Some text.

Description

source "with_examples.sh"

echo ABC
ABC

Another text

source "with_examples.sh"

echo 123

echo 456
123
456

With an array:

source "with_examples.sh"

declare -a arr=(abc def ghi)

echo "first_elem=${arr[0]}"
first_elem=abc

With a if

source "with_examples.sh"

if true ; then
  echo YES
else
  echo NO
fi
YES