#!/bin/bash main() { echo "This line will be only printed once!" return 0 } { main "$@" exit "$?" }