I have files like this$ cat trapetzx = 0:0.0001:7piplot(x, sin(x).*cos(x))Area = trapz(x, sin(x).*cos(x))$ cat simpson f = inline(sin(x).*cos(x));Area2 = quad(f, 0, 7pi, 1e-16)I want something like this$ cat -b -t MISSING? trapetz simpson      traapetz      1  x = 0:0.0001:7pi     2  plot(x, sin(x).*cos(x))     3  Area = trapz(x, sin(x).*cos(x))     simpson     1  f = inline(sin(x).*cos(x));     2  Area2 = quad(f, 0, 7pi, 1e-16)or even better if some easy way to add wc there:$ find |tee |...|wc... I feel now reinventing the wheel, there must be some ready...     traapetz: xyz chars     1  x = 0:0.0001:7pi     2  plot(x, sin(x).*cos(x))     3  Area = trapz(x, sin(x).*cos(x))     simpson: zyx chars     1  f = inline(sin(x).*cos(x));     2  Area2 = quad(f, 0, 7pi, 1e-16)but I get$ cat -b -t trapetz simpson      1  x = 0:0.0001:7pi     2  plot(x, sin(x).*cos(x))     3  Area = trapz(x, sin(x).*cos(x))     4  f = inline(sin(x).*cos(x));     5  Area2 = quad(f, 0, 7pi, 1e-16)Not really cat needed but some easy tool to share and show code snippets like the above, not pastebin. I want some standard command line thing. I am trying to create easy puzzle -pasting for codegolf.se so people could reproduce things easily...
Cat with Headers and Line Numbers?
cat
A very rough awk implementation:BEGIN{    OLDFILENAME=;}FNR==1{    if (OLDFILENAME != ) {        printf(#### Processed (chars: %s - lines: %s)\n, FWC, FLC);    }    printf(#### Processing: %s\n, FILENAME);    OLDFILENAME=FILENAME;    FWC=0;    FLC=0;}{    printf(%04d - %s\n, FNR, $0);    FWC = FWC + length($0);    FLC = FLC + 1;}END{    if (OLDFILENAME != ) {        printf(#### Processed (chars: %s - lines: %s)\n, FWC, FLC);    }}Execute awk -f AWKFILE trapetz simpson to get:#### Processing: trapetz0001 - x = 0:0.0001:7pi0002 - plot(x, sin(x).*cos(x))0003 - Area = trapz(x, sin(x).*cos(x))#### Processed (chars: 70 - lines: 3)#### Processing: simpson0001 - f = inline(sin(x).*cos(x));0002 - Area2 = quad(f, 0, 7pi, 1e-16)#### Processed (chars: 57 - lines: 2)