`eval "$@"` would do the job:
#!/bin/bash
f() {
echo "command: $@"
eval "$@"
}
but in general it's very unsafe to use it even though you'll see it here and there.
`eval "$@"` would do the job:
#!/bin/bash
f() {
echo "command: $@"
eval "$@"
}
but in general it's very unsafe to use it even though you'll see it here and there.