I want to display what I’m running, but when the commands contain space parameter, it failed.
#!/bin/bash
go() {
echo "*** $*"
$* || exit 1
}
go make NAME="Hi Here"
That will get wrong behavior like
make NAME=Hi Here
Is there any better method to improve the go() function?
Replace $* with “$@”: