I wanted to use DTrace to see "what syscalls are made by my shell script".
I made a very simple shell script, shell.sh
, and gave it execute privileges:
#!/bin/bash
grep 1 <<< 123
I cd
'd into its directory, and ran this simple DTrace script:
sudo dtrace -n 'syscall:::entry
/pid == $target/
{
@[probefunc] = count();
}' -c ./trace-me.sh
I get this error output:
dtrace: failed to execute ./trace-me.sh: unknown error
What happened here? I've run csrutil enable --without dtrace
. The DTrace script runs fine if I remove the -c
arg (and replace $target
with a pid).
Is this just another Mac gotcha? I'm running macOS Sierra 10.12.5 Beta.