summaryrefslogtreecommitdiffhomepage
path: root/scripts/utils/print-and-run
blob: b323040f3c99a95e9380547067ca38e2108a8fa1 (plain)
1
2
3
4
5
6
7
8
9
#!/usr/bin/env bash

# This is a small utility script that can be sourced to provide a function that prints its arguments
# and then calls them as a command, e.g. `print_and_run sleep 5`.

function print_and_run {
    echo "+ $*"
    "$@"
}