File: with_examples.sh
Some text.
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"
first_elem=abc
With a if
source "with_examples.sh" if true ; then echo YES else echo NO fi
YES