Skip to content

Instantly share code, notes, and snippets.

@casperklein
Last active November 2, 2023 23:34
Show Gist options
  • Save casperklein/6ee1af3a0d2bbb77d1c3dd933f1defa4 to your computer and use it in GitHub Desktop.
Save casperklein/6ee1af3a0d2bbb77d1c3dd933f1defa4 to your computer and use it in GitHub Desktop.
#!/bin/bash
[ $# -lt 2 ] && echo "Usage: $0 <env file> <binary> [args]" && exit 1
# Mark variables which are modified or created for export.
set -a
# source env file
source "$1"
# run binary with arguments
shift
exec "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment