How can I redirect only Dtrace's output when running a script with the -C flag?
like in this case:
dscript.d -s myscript.d -c date
Note: I found the answer to my question before posting it, but I'm putting it here so it's part of SO.
How can I redirect only Dtrace's output when running a script with the -C flag?
like in this case:
dscript.d -s myscript.d -c date
Note: I found the answer to my question before posting it, but I'm putting it here so it's part of SO.
One solution with pipes is:
dtrace -o /dev/fd/3 -s dscript.d -c date 3>&1 1>out 2>err
which says:
Or the more simpler method is to do:
dtrace -o log.txt -s dscript.d -c date