Print top output only once on Mac OS X

There's logging mode, with an argument specifying how often output will be repeated, 0 being until aborted. To print once and exit:

$ top -l 1

top -l3 -n30 > test ; tail -n42 ./test > ./test2 ; open ./test2

You need to repeat at least three times to have the correct CPU statistics, which is done by the option -l3.

I keep the 30 most important jobs, which I extract from the log file with tail.

top -l alone does not do the job for me.