In the first usage, the break column is the first column named in the command line or the first (leftmost) column in table if no columns are specified. Values in the remaining numeric columns of table are accumulated until break column changes. When the break column changes, the accumulated values in the second and subsequent columns named on the command line (or all remaining columns, if none are specified), are printed out. This syntax is provided for compatibility with previous versions of subtotal.
The second usage of subtotal is distinguished by the -t switch, which is used in the command line to separate the names of the break columns to the left of it from the names of the columns to be accumulated on the right of it. The right-to-left order in which the break columns are specified determines the order in which they are checked for changes.
If no break columns are named then subtotal assumes that all columns with the exception of those named to the right of the -t switch are break columns. If no column names are specified to the right of the -t switch, then all remaining numeric columns are accumulated by the break column(s) specified. Finally, if no break columns are specified to the left of the -t switch, and no columns are specified to the right of it, subtotal behaves like total, and accumulates all numeric columns.
$ cat phonebill mm dd city minutes -- -- ---- -------- 08 01 NYC 20 08 01 NYC 25 08 01 Albany 3 08 05 Chicago 34 08 07 Dallas 28 09 01 Albany 45 09 12 Dallas 52SEE ALSO$ subtotal -e -s '--' -t minutes < phonebill | justify mm dd city minutes -- -- ------- ------- 08 01 NYC 45 08 01 Albany 3 08 01 -- 48 08 05 Chicago 34 08 05 -- 34 08 07 Dallas 28 08 07 -- 28 08 -- -- 110 09 01 Albany 45 09 01 -- 45 09 12 Dallas 52 09 12 -- 52 09 -- -- 97 -- -- -- 207