Ekaterina Pavlova
2007-Jan-31 21:30 UTC
[dtrace-discuss] "dtrace -c" : how to redirect output
Hi, Is it possible to redirect the output of the command specified as -c argument? I.e. to do something like: # dscript.d -c "date 1>out 2>err" thanks in advance, -katya
Michael Shapiro
2007-Jan-31 22:27 UTC
[dtrace-discuss] "dtrace -c" : how to redirect output
> Hi, > > Is it possible to redirect the output of the command specified as -c > argument? > I.e. to do something like: > # dscript.d -c "date 1>out 2>err" > > thanks in advance, > -katyaWe don''t support shell expansions in the -c argument. If you want to do the above, one easy way from ksh or bash is this: dtrace -o /dev/fd/3 -s dscript.d -c date 3>&1 1>out 2>err which says: dtrace''s stdout goes to fd 3, which is dup''d from the current stdout dtrace''s stderr goes to ''err'' date''s stdout is modified to ''out'' date''s stderr is modified to ''err'' Or you can use -o to specify a particular output file. -Mike -- Mike Shapiro, Solaris Kernel Development. blogs.sun.com/mws/