#!/bin/bash set -x # put here dirs that must be made persistent list_dirs() { cat <> "$bashrc" done } _dirs _main setup_bashrc # print cmd that will be executed echo "Starting: $*" >&2 # launch CMD exec "$@"