[dtrace-discuss] dtrace language reference

Peter Lawrence
Tue, 15 May 2007 19:20:44 -0000

Michael,
        even if this is true, the problem becomes one of documentation.
it is darn hard to figure out from the Solaris DTrace Guide. instead of
being in the intro where "how to run" dtrace is covered, the
information
is burried fifteen chapters later.

and here''s the nawk man page info on its "-f" option:

     If -f progfile is specified, the files named by each of  the
     progfile  option-arguments  must be text files containing an
     nawk program.

     The standard input are used only if  no  file  operands  are
     specified, or if a file operand is -.

it doesn''t say anything about needing the "-f" in a
"#!" script file,
in fact this information is no-where in the nawk man page.


The point of the whole email is really this, while there may be a
convention about requiring "-f" or "-s" in a "#!"
script program
file for some languages, it is never adequately documented, and
is always counter-intuitive.

Try this yourself, write a dtrace script without the "-s" and try
to figure out what you did wrong by reading the diagnostic error
messages output. and notice what happens to the diagnostics when
you either do or don''t have other options in the "#!" line.


within a "#!" script file the "-s" option is totally
redundant,
what else could the rest of the file be .....?????.....


-Pete Lawrence.









 Schuster wrote On 05/15/07 11:27 AM,:
> Peter Lawrence wrote:
>
>>Charles,
>>        you forgot to note that the "-s" in the "#!"
line isn''t
>>optional (a fact which is extremely annoying, as it is inconsistent
>>with all other scripting languages that I''m aware of).
>
>
> (n)awk has the same requirement:
>
> #!/usr/bin/nawk -f
> bla ...
>
> if you take away the -f, you get a syntax error.
>
> Michael