

================================================================
MAPPER TEE REDIRECTS

mlr --from ./reg-test/input/abixy tee ./output-reg-test/tee1/out then nothing

cat ./output-reg-test/tee1/out
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694
a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006
a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864

mlr --from ./reg-test/input/abixy tee --no-fflush ./output-reg-test/tee1/out then nothing

cat ./output-reg-test/tee1/out
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694
a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006
a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864

mlr --from ./reg-test/input/abixy tee -a ./output-reg-test/tee1/out then nothing

cat ./output-reg-test/tee1/out
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694
a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006
a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694
a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006
a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864

mlr --from ./reg-test/input/abixy tee -o json ./output-reg-test/tee1/out then nothing

cat ./output-reg-test/tee1/out
{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533 }
{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 }
{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463 }
{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729 }
{ "a": "zee", "b": "pan", "i": 6, "x": 0.5271261600918548, "y": 0.49322128674835697 }
{ "a": "eks", "b": "zee", "i": 7, "x": 0.6117840605678454, "y": 0.1878849191181694 }
{ "a": "zee", "b": "wye", "i": 8, "x": 0.5985540091064224, "y": 0.976181385699006 }
{ "a": "hat", "b": "wye", "i": 9, "x": 0.03144187646093577, "y": 0.7495507603507059 }
{ "a": "pan", "b": "wye", "i": 10, "x": 0.5026260055412137, "y": 0.9526183602969864 }


================================================================
DSL TEE REDIRECTS

mlr put -q tee > "./output-reg-test/tee2/out.".$a, $* ./reg-test/input/abixy

cat ./output-reg-test/tee2/out.eks
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694

cat ./output-reg-test/tee2/out.hat
a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059

cat ./output-reg-test/tee2/out.pan
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864

cat ./output-reg-test/tee2/out.wye
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729

cat ./output-reg-test/tee2/out.zee
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006

mlr put -q --no-fflush tee > "./output-reg-test/tee2/out.".$a, $* ./reg-test/input/abixy

cat ./output-reg-test/tee2/out.eks
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694

cat ./output-reg-test/tee2/out.hat
a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059

cat ./output-reg-test/tee2/out.pan
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864

cat ./output-reg-test/tee2/out.wye
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729

cat ./output-reg-test/tee2/out.zee
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006

mlr put -q tee >> "./output-reg-test/tee2/out.".$a, $* ./reg-test/input/abixy

cat ./output-reg-test/tee2/out.eks
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694

cat ./output-reg-test/tee2/out.hat
a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059
a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059

cat ./output-reg-test/tee2/out.pan
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864

cat ./output-reg-test/tee2/out.wye
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729

cat ./output-reg-test/tee2/out.zee
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006

mlr put -q -o json tee > "./output-reg-test/tee2/out.".$a, $* ./reg-test/input/abixy

cat ./output-reg-test/tee2/out.eks
{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463 }
{ "a": "eks", "b": "zee", "i": 7, "x": 0.6117840605678454, "y": 0.1878849191181694 }

cat ./output-reg-test/tee2/out.hat
{ "a": "hat", "b": "wye", "i": 9, "x": 0.03144187646093577, "y": 0.7495507603507059 }

cat ./output-reg-test/tee2/out.pan
{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533 }
{ "a": "pan", "b": "wye", "i": 10, "x": 0.5026260055412137, "y": 0.9526183602969864 }

cat ./output-reg-test/tee2/out.wye
{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 }
{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729 }

cat ./output-reg-test/tee2/out.zee
{ "a": "zee", "b": "pan", "i": 6, "x": 0.5271261600918548, "y": 0.49322128674835697 }
{ "a": "zee", "b": "wye", "i": 8, "x": 0.5985540091064224, "y": 0.976181385699006 }

mlr put -q tee | "tr \[a-z\] \[A-Z\]", $* ./reg-test/input/abixy
A=PAN,B=PAN,I=1,X=0.3467901443380824,Y=0.7268028627434533
A=EKS,B=PAN,I=2,X=0.7586799647899636,Y=0.5221511083334797
A=WYE,B=WYE,I=3,X=0.20460330576630303,Y=0.33831852551664776
A=EKS,B=WYE,I=4,X=0.38139939387114097,Y=0.13418874328430463
A=WYE,B=PAN,I=5,X=0.5732889198020006,Y=0.8636244699032729
A=ZEE,B=PAN,I=6,X=0.5271261600918548,Y=0.49322128674835697
A=EKS,B=ZEE,I=7,X=0.6117840605678454,Y=0.1878849191181694
A=ZEE,B=WYE,I=8,X=0.5985540091064224,Y=0.976181385699006
A=HAT,B=WYE,I=9,X=0.03144187646093577,Y=0.7495507603507059
A=PAN,B=WYE,I=10,X=0.5026260055412137,Y=0.9526183602969864

mlr put -q -o json tee | "tr \[a-z\] \[A-Z\]", $* ./reg-test/input/abixy
{ "A": "PAN", "B": "PAN", "I": 1, "X": 0.3467901443380824, "Y": 0.7268028627434533 }
{ "A": "EKS", "B": "PAN", "I": 2, "X": 0.7586799647899636, "Y": 0.5221511083334797 }
{ "A": "WYE", "B": "WYE", "I": 3, "X": 0.20460330576630303, "Y": 0.33831852551664776 }
{ "A": "EKS", "B": "WYE", "I": 4, "X": 0.38139939387114097, "Y": 0.13418874328430463 }
{ "A": "WYE", "B": "PAN", "I": 5, "X": 0.5732889198020006, "Y": 0.8636244699032729 }
{ "A": "ZEE", "B": "PAN", "I": 6, "X": 0.5271261600918548, "Y": 0.49322128674835697 }
{ "A": "EKS", "B": "ZEE", "I": 7, "X": 0.6117840605678454, "Y": 0.1878849191181694 }
{ "A": "ZEE", "B": "WYE", "I": 8, "X": 0.5985540091064224, "Y": 0.976181385699006 }
{ "A": "HAT", "B": "WYE", "I": 9, "X": 0.03144187646093577, "Y": 0.7495507603507059 }
{ "A": "PAN", "B": "WYE", "I": 10, "X": 0.5026260055412137, "Y": 0.9526183602969864 }

mlr put -q tee > stdout, $* ./reg-test/input/abixy
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694
a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006
a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864

cat ./output-reg-test/tee2/err1

mlr put -q tee > stderr, $* ./reg-test/input/abixy

cat ./output-reg-test/tee2/err2


================================================================
DSL PRINT REDIRECTS

mlr put -q print > "./output-reg-test/print1/out.".$a, "abi:".$a.$b.$i ./reg-test/input/abixy

cat ./output-reg-test/print1/out.eks
abi:ekspan2
abi:ekswye4
abi:ekszee7

cat ./output-reg-test/print1/out.hat
abi:hatwye9

cat ./output-reg-test/print1/out.pan
abi:panpan1
abi:panwye10

cat ./output-reg-test/print1/out.wye
abi:wyewye3
abi:wyepan5

cat ./output-reg-test/print1/out.zee
abi:zeepan6
abi:zeewye8

mlr put -q print > "./output-reg-test/print1/out.".$a, "abi:".$a.$b.$i ./reg-test/input/abixy

cat ./output-reg-test/print1/out.eks
abi:ekspan2
abi:ekswye4
abi:ekszee7

cat ./output-reg-test/print1/out.hat
abi:hatwye9

cat ./output-reg-test/print1/out.pan
abi:panpan1
abi:panwye10

cat ./output-reg-test/print1/out.wye
abi:wyewye3
abi:wyepan5

cat ./output-reg-test/print1/out.zee
abi:zeepan6
abi:zeewye8

mlr put -q print >> "./output-reg-test/print1/out.".$a, "abi:".$a.$b.$i ./reg-test/input/abixy

cat ./output-reg-test/print1/out.eks
abi:ekspan2
abi:ekswye4
abi:ekszee7
abi:ekspan2
abi:ekswye4
abi:ekszee7

cat ./output-reg-test/print1/out.hat
abi:hatwye9
abi:hatwye9

cat ./output-reg-test/print1/out.pan
abi:panpan1
abi:panwye10
abi:panpan1
abi:panwye10

cat ./output-reg-test/print1/out.wye
abi:wyewye3
abi:wyepan5
abi:wyewye3
abi:wyepan5

cat ./output-reg-test/print1/out.zee
abi:zeepan6
abi:zeewye8
abi:zeepan6
abi:zeewye8

mlr put -q print | "tr \[a-z\] \[A-Z\]",  "abi:".$a.$b.$i ./reg-test/input/abixy
ABI:PANPAN1
ABI:EKSPAN2
ABI:WYEWYE3
ABI:EKSWYE4
ABI:WYEPAN5
ABI:ZEEPAN6
ABI:EKSZEE7
ABI:ZEEWYE8
ABI:HATWYE9
ABI:PANWYE10

mlr put -q print > stdout, "abi:".$a.$b.$i ./reg-test/input/abixy
abi:panpan1
abi:ekspan2
abi:wyewye3
abi:ekswye4
abi:wyepan5
abi:zeepan6
abi:ekszee7
abi:zeewye8
abi:hatwye9
abi:panwye10

cat ./output-reg-test/print1/err1

mlr put -q print > stderr, "abi:".$a.$b.$i ./reg-test/input/abixy

cat ./output-reg-test/print1/err2


================================================================
DSL PRINTN REDIRECTS

mlr put -q printn > "./output-reg-test/printn1/out.".$a, "abi:".$a.$b.$i ./reg-test/input/abixy

cat ./output-reg-test/printn1/out.eks
abi:ekspan2abi:ekswye4abi:ekszee7
cat ./output-reg-test/printn1/out.hat
abi:hatwye9
cat ./output-reg-test/printn1/out.pan
abi:panpan1abi:panwye10
cat ./output-reg-test/printn1/out.wye
abi:wyewye3abi:wyepan5
cat ./output-reg-test/printn1/out.zee
abi:zeepan6abi:zeewye8
mlr put -q printn > "./output-reg-test/printn1/out.".$a, "abi:".$a.$b.$i ./reg-test/input/abixy

cat ./output-reg-test/printn1/out.eks
abi:ekspan2abi:ekswye4abi:ekszee7
cat ./output-reg-test/printn1/out.hat
abi:hatwye9
cat ./output-reg-test/printn1/out.pan
abi:panpan1abi:panwye10
cat ./output-reg-test/printn1/out.wye
abi:wyewye3abi:wyepan5
cat ./output-reg-test/printn1/out.zee
abi:zeepan6abi:zeewye8
mlr put -q printn >> "./output-reg-test/printn1/out.".$a, "abi:".$a.$b.$i ./reg-test/input/abixy

cat ./output-reg-test/printn1/out.eks
abi:ekspan2abi:ekswye4abi:ekszee7abi:ekspan2abi:ekswye4abi:ekszee7
cat ./output-reg-test/printn1/out.hat
abi:hatwye9abi:hatwye9
cat ./output-reg-test/printn1/out.pan
abi:panpan1abi:panwye10abi:panpan1abi:panwye10
cat ./output-reg-test/printn1/out.wye
abi:wyewye3abi:wyepan5abi:wyewye3abi:wyepan5
cat ./output-reg-test/printn1/out.zee
abi:zeepan6abi:zeewye8abi:zeepan6abi:zeewye8
mlr put -q printn | "tr \[a-z\] \[A-Z\]",  "abi:".$a.$b.$i ./reg-test/input/abixy
ABI:PANPAN1ABI:EKSPAN2ABI:WYEWYE3ABI:EKSWYE4ABI:WYEPAN5ABI:ZEEPAN6ABI:EKSZEE7ABI:ZEEWYE8ABI:HATWYE9ABI:PANWYE10
mlr put -q printn > stdout, "abi:".$a.$b.$i ./reg-test/input/abixy
abi:panpan1abi:ekspan2abi:wyewye3abi:ekswye4abi:wyepan5abi:zeepan6abi:ekszee7abi:zeewye8abi:hatwye9abi:panwye10
cat ./output-reg-test/printn1/err1

mlr put -q printn > stderr, "abi:".$a.$b.$i ./reg-test/input/abixy

cat ./output-reg-test/printn1/err2


================================================================
DSL DUMP REDIRECTS

mlr put -q @v=$*; dump > "./output-reg-test/dump1/out.".$a ./reg-test/input/abixy

cat ./output-reg-test/dump1/out.eks
{
  "v": {
    "a": "eks",
    "b": "pan",
    "i": 2,
    "x": 0.7586799647899636,
    "y": 0.5221511083334797
  }
}
{
  "v": {
    "a": "eks",
    "b": "wye",
    "i": 4,
    "x": 0.38139939387114097,
    "y": 0.13418874328430463
  }
}
{
  "v": {
    "a": "eks",
    "b": "zee",
    "i": 7,
    "x": 0.6117840605678454,
    "y": 0.1878849191181694
  }
}

cat ./output-reg-test/dump1/out.hat
{
  "v": {
    "a": "hat",
    "b": "wye",
    "i": 9,
    "x": 0.03144187646093577,
    "y": 0.7495507603507059
  }
}

cat ./output-reg-test/dump1/out.pan
{
  "v": {
    "a": "pan",
    "b": "pan",
    "i": 1,
    "x": 0.3467901443380824,
    "y": 0.7268028627434533
  }
}
{
  "v": {
    "a": "pan",
    "b": "wye",
    "i": 10,
    "x": 0.5026260055412137,
    "y": 0.9526183602969864
  }
}

cat ./output-reg-test/dump1/out.wye
{
  "v": {
    "a": "wye",
    "b": "wye",
    "i": 3,
    "x": 0.20460330576630303,
    "y": 0.33831852551664776
  }
}
{
  "v": {
    "a": "wye",
    "b": "pan",
    "i": 5,
    "x": 0.5732889198020006,
    "y": 0.8636244699032729
  }
}

cat ./output-reg-test/dump1/out.zee
{
  "v": {
    "a": "zee",
    "b": "pan",
    "i": 6,
    "x": 0.5271261600918548,
    "y": 0.49322128674835697
  }
}
{
  "v": {
    "a": "zee",
    "b": "wye",
    "i": 8,
    "x": 0.5985540091064224,
    "y": 0.976181385699006
  }
}

mlr put -q @v=$*; dump > "./output-reg-test/dump1/out.".$a ./reg-test/input/abixy

cat ./output-reg-test/dump1/out.eks
{
  "v": {
    "a": "eks",
    "b": "pan",
    "i": 2,
    "x": 0.7586799647899636,
    "y": 0.5221511083334797
  }
}
{
  "v": {
    "a": "eks",
    "b": "wye",
    "i": 4,
    "x": 0.38139939387114097,
    "y": 0.13418874328430463
  }
}
{
  "v": {
    "a": "eks",
    "b": "zee",
    "i": 7,
    "x": 0.6117840605678454,
    "y": 0.1878849191181694
  }
}

cat ./output-reg-test/dump1/out.hat
{
  "v": {
    "a": "hat",
    "b": "wye",
    "i": 9,
    "x": 0.03144187646093577,
    "y": 0.7495507603507059
  }
}

cat ./output-reg-test/dump1/out.pan
{
  "v": {
    "a": "pan",
    "b": "pan",
    "i": 1,
    "x": 0.3467901443380824,
    "y": 0.7268028627434533
  }
}
{
  "v": {
    "a": "pan",
    "b": "wye",
    "i": 10,
    "x": 0.5026260055412137,
    "y": 0.9526183602969864
  }
}

cat ./output-reg-test/dump1/out.wye
{
  "v": {
    "a": "wye",
    "b": "wye",
    "i": 3,
    "x": 0.20460330576630303,
    "y": 0.33831852551664776
  }
}
{
  "v": {
    "a": "wye",
    "b": "pan",
    "i": 5,
    "x": 0.5732889198020006,
    "y": 0.8636244699032729
  }
}

cat ./output-reg-test/dump1/out.zee
{
  "v": {
    "a": "zee",
    "b": "pan",
    "i": 6,
    "x": 0.5271261600918548,
    "y": 0.49322128674835697
  }
}
{
  "v": {
    "a": "zee",
    "b": "wye",
    "i": 8,
    "x": 0.5985540091064224,
    "y": 0.976181385699006
  }
}

mlr put -q @v=$*; dump >> "./output-reg-test/dump1/out.".$a ./reg-test/input/abixy

cat ./output-reg-test/dump1/out.eks
{
  "v": {
    "a": "eks",
    "b": "pan",
    "i": 2,
    "x": 0.7586799647899636,
    "y": 0.5221511083334797
  }
}
{
  "v": {
    "a": "eks",
    "b": "wye",
    "i": 4,
    "x": 0.38139939387114097,
    "y": 0.13418874328430463
  }
}
{
  "v": {
    "a": "eks",
    "b": "zee",
    "i": 7,
    "x": 0.6117840605678454,
    "y": 0.1878849191181694
  }
}
{
  "v": {
    "a": "eks",
    "b": "pan",
    "i": 2,
    "x": 0.7586799647899636,
    "y": 0.5221511083334797
  }
}
{
  "v": {
    "a": "eks",
    "b": "wye",
    "i": 4,
    "x": 0.38139939387114097,
    "y": 0.13418874328430463
  }
}
{
  "v": {
    "a": "eks",
    "b": "zee",
    "i": 7,
    "x": 0.6117840605678454,
    "y": 0.1878849191181694
  }
}

cat ./output-reg-test/dump1/out.hat
{
  "v": {
    "a": "hat",
    "b": "wye",
    "i": 9,
    "x": 0.03144187646093577,
    "y": 0.7495507603507059
  }
}
{
  "v": {
    "a": "hat",
    "b": "wye",
    "i": 9,
    "x": 0.03144187646093577,
    "y": 0.7495507603507059
  }
}

cat ./output-reg-test/dump1/out.pan
{
  "v": {
    "a": "pan",
    "b": "pan",
    "i": 1,
    "x": 0.3467901443380824,
    "y": 0.7268028627434533
  }
}
{
  "v": {
    "a": "pan",
    "b": "wye",
    "i": 10,
    "x": 0.5026260055412137,
    "y": 0.9526183602969864
  }
}
{
  "v": {
    "a": "pan",
    "b": "pan",
    "i": 1,
    "x": 0.3467901443380824,
    "y": 0.7268028627434533
  }
}
{
  "v": {
    "a": "pan",
    "b": "wye",
    "i": 10,
    "x": 0.5026260055412137,
    "y": 0.9526183602969864
  }
}

cat ./output-reg-test/dump1/out.wye
{
  "v": {
    "a": "wye",
    "b": "wye",
    "i": 3,
    "x": 0.20460330576630303,
    "y": 0.33831852551664776
  }
}
{
  "v": {
    "a": "wye",
    "b": "pan",
    "i": 5,
    "x": 0.5732889198020006,
    "y": 0.8636244699032729
  }
}
{
  "v": {
    "a": "wye",
    "b": "wye",
    "i": 3,
    "x": 0.20460330576630303,
    "y": 0.33831852551664776
  }
}
{
  "v": {
    "a": "wye",
    "b": "pan",
    "i": 5,
    "x": 0.5732889198020006,
    "y": 0.8636244699032729
  }
}

cat ./output-reg-test/dump1/out.zee
{
  "v": {
    "a": "zee",
    "b": "pan",
    "i": 6,
    "x": 0.5271261600918548,
    "y": 0.49322128674835697
  }
}
{
  "v": {
    "a": "zee",
    "b": "wye",
    "i": 8,
    "x": 0.5985540091064224,
    "y": 0.976181385699006
  }
}
{
  "v": {
    "a": "zee",
    "b": "pan",
    "i": 6,
    "x": 0.5271261600918548,
    "y": 0.49322128674835697
  }
}
{
  "v": {
    "a": "zee",
    "b": "wye",
    "i": 8,
    "x": 0.5985540091064224,
    "y": 0.976181385699006
  }
}

mlr put -q @v=$*; dump | "tr \[a-z\] \[A-Z\]" ./reg-test/input/abixy
{
  "V": {
    "A": "PAN",
    "B": "PAN",
    "I": 1,
    "X": 0.3467901443380824,
    "Y": 0.7268028627434533
  }
}
{
  "V": {
    "A": "EKS",
    "B": "PAN",
    "I": 2,
    "X": 0.7586799647899636,
    "Y": 0.5221511083334797
  }
}
{
  "V": {
    "A": "WYE",
    "B": "WYE",
    "I": 3,
    "X": 0.20460330576630303,
    "Y": 0.33831852551664776
  }
}
{
  "V": {
    "A": "EKS",
    "B": "WYE",
    "I": 4,
    "X": 0.38139939387114097,
    "Y": 0.13418874328430463
  }
}
{
  "V": {
    "A": "WYE",
    "B": "PAN",
    "I": 5,
    "X": 0.5732889198020006,
    "Y": 0.8636244699032729
  }
}
{
  "V": {
    "A": "ZEE",
    "B": "PAN",
    "I": 6,
    "X": 0.5271261600918548,
    "Y": 0.49322128674835697
  }
}
{
  "V": {
    "A": "EKS",
    "B": "ZEE",
    "I": 7,
    "X": 0.6117840605678454,
    "Y": 0.1878849191181694
  }
}
{
  "V": {
    "A": "ZEE",
    "B": "WYE",
    "I": 8,
    "X": 0.5985540091064224,
    "Y": 0.976181385699006
  }
}
{
  "V": {
    "A": "HAT",
    "B": "WYE",
    "I": 9,
    "X": 0.03144187646093577,
    "Y": 0.7495507603507059
  }
}
{
  "V": {
    "A": "PAN",
    "B": "WYE",
    "I": 10,
    "X": 0.5026260055412137,
    "Y": 0.9526183602969864
  }
}

mlr put -q @v[NR] = $*; NR == 2 { dump > stdout } ./reg-test/input/abixy
{
  "v": {
    "1": {
      "a": "pan",
      "b": "pan",
      "i": 1,
      "x": 0.3467901443380824,
      "y": 0.7268028627434533
    },
    "2": {
      "a": "eks",
      "b": "pan",
      "i": 2,
      "x": 0.7586799647899636,
      "y": 0.5221511083334797
    }
  }
}

cat ./output-reg-test/dump1/err1

mlr put -q @v[NR] = $*; NR == 2 { dump > stderr } ./reg-test/input/abixy

cat ./output-reg-test/dump1/err2


================================================================
DSL EMITF REDIRECTS

mlr put -q @a=$a; @b=$b; emitf > "./output-reg-test/emitf1/out.".$a.$b, @a, @b ./reg-test/input/abixy

cat ./output-reg-test/emitf1/out.ekspan
a=eks,b=pan

cat ./output-reg-test/emitf1/out.ekswye
a=eks,b=wye

cat ./output-reg-test/emitf1/out.ekszee
a=eks,b=zee

cat ./output-reg-test/emitf1/out.hatwye
a=hat,b=wye

cat ./output-reg-test/emitf1/out.panpan
a=pan,b=pan

cat ./output-reg-test/emitf1/out.panwye
a=pan,b=wye

cat ./output-reg-test/emitf1/out.wyepan
a=wye,b=pan

cat ./output-reg-test/emitf1/out.wyewye
a=wye,b=wye

cat ./output-reg-test/emitf1/out.zeepan
a=zee,b=pan

cat ./output-reg-test/emitf1/out.zeewye
a=zee,b=wye

mlr put -q @a=$a; @b=$b; emitf > "./output-reg-test/emitf1/out.".$a.$b, @a, @b ./reg-test/input/abixy

cat ./output-reg-test/emitf1/out.ekspan
a=eks,b=pan

cat ./output-reg-test/emitf1/out.ekswye
a=eks,b=wye

cat ./output-reg-test/emitf1/out.ekszee
a=eks,b=zee

cat ./output-reg-test/emitf1/out.hatwye
a=hat,b=wye

cat ./output-reg-test/emitf1/out.panpan
a=pan,b=pan

cat ./output-reg-test/emitf1/out.panwye
a=pan,b=wye

cat ./output-reg-test/emitf1/out.wyepan
a=wye,b=pan

cat ./output-reg-test/emitf1/out.wyewye
a=wye,b=wye

cat ./output-reg-test/emitf1/out.zeepan
a=zee,b=pan

cat ./output-reg-test/emitf1/out.zeewye
a=zee,b=wye

mlr put -q @a=$a; @b=$b; emitf >> "./output-reg-test/emitf1/out.".$a.$b, @a, @b ./reg-test/input/abixy

cat ./output-reg-test/emitf1/out.ekspan
a=eks,b=pan
a=eks,b=pan

cat ./output-reg-test/emitf1/out.ekswye
a=eks,b=wye
a=eks,b=wye

cat ./output-reg-test/emitf1/out.ekszee
a=eks,b=zee
a=eks,b=zee

cat ./output-reg-test/emitf1/out.hatwye
a=hat,b=wye
a=hat,b=wye

cat ./output-reg-test/emitf1/out.panpan
a=pan,b=pan
a=pan,b=pan

cat ./output-reg-test/emitf1/out.panwye
a=pan,b=wye
a=pan,b=wye

cat ./output-reg-test/emitf1/out.wyepan
a=wye,b=pan
a=wye,b=pan

cat ./output-reg-test/emitf1/out.wyewye
a=wye,b=wye
a=wye,b=wye

cat ./output-reg-test/emitf1/out.zeepan
a=zee,b=pan
a=zee,b=pan

cat ./output-reg-test/emitf1/out.zeewye
a=zee,b=wye
a=zee,b=wye

mlr put -q -o json @a=$a; @b=$b; emitf > "./output-reg-test/emitf1/out.".$a.$b, @a, @b ./reg-test/input/abixy

cat ./output-reg-test/emitf1/out.ekspan
{ "a": "eks", "b": "pan" }

cat ./output-reg-test/emitf1/out.ekswye
{ "a": "eks", "b": "wye" }

cat ./output-reg-test/emitf1/out.ekszee
{ "a": "eks", "b": "zee" }

cat ./output-reg-test/emitf1/out.hatwye
{ "a": "hat", "b": "wye" }

cat ./output-reg-test/emitf1/out.panpan
{ "a": "pan", "b": "pan" }

cat ./output-reg-test/emitf1/out.panwye
{ "a": "pan", "b": "wye" }

cat ./output-reg-test/emitf1/out.wyepan
{ "a": "wye", "b": "pan" }

cat ./output-reg-test/emitf1/out.wyewye
{ "a": "wye", "b": "wye" }

cat ./output-reg-test/emitf1/out.zeepan
{ "a": "zee", "b": "pan" }

cat ./output-reg-test/emitf1/out.zeewye
{ "a": "zee", "b": "wye" }

mlr put -q @a=$a; @b=$b; emitf | "tr \[a-z\] \[A-Z\]", @a, @b ./reg-test/input/abixy
A=PAN,B=PAN
A=EKS,B=PAN
A=WYE,B=WYE
A=EKS,B=WYE
A=WYE,B=PAN
A=ZEE,B=PAN
A=EKS,B=ZEE
A=ZEE,B=WYE
A=HAT,B=WYE
A=PAN,B=WYE

mlr put -q @a=$a; @b=$b; emitf > stdout, @a, @b ./reg-test/input/abixy
a=pan,b=pan
a=eks,b=pan
a=wye,b=wye
a=eks,b=wye
a=wye,b=pan
a=zee,b=pan
a=eks,b=zee
a=zee,b=wye
a=hat,b=wye
a=pan,b=wye

cat ./output-reg-test/emitf1/err1

mlr put -q @a=$a; @b=$b; emitf > stderr, @a, @b ./reg-test/input/abixy

cat ./output-reg-test/emitf1/err2


================================================================
DSL EMITP REDIRECTS

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp1/out.".$a.$b, @a ./reg-test/input/abixy

cat ./output-reg-test/emitp1/out.ekspan
a:1=pan,a:2=eks

cat ./output-reg-test/emitp1/out.ekswye
a:1=pan,a:2=eks,a:3=wye,a:4=eks

cat ./output-reg-test/emitp1/out.panpan
a:1=pan

cat ./output-reg-test/emitp1/out.wyewye
a:1=pan,a:2=eks,a:3=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp1/out.".$a.$b, @a ./reg-test/input/abixy

cat ./output-reg-test/emitp1/out.ekspan
a:1=pan,a:2=eks

cat ./output-reg-test/emitp1/out.ekswye
a:1=pan,a:2=eks,a:3=wye,a:4=eks

cat ./output-reg-test/emitp1/out.panpan
a:1=pan

cat ./output-reg-test/emitp1/out.wyewye
a:1=pan,a:2=eks,a:3=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp >> "./output-reg-test/emitp1/out.".$a.$b, @a ./reg-test/input/abixy

cat ./output-reg-test/emitp1/out.ekspan
a:1=pan,a:2=eks
a:1=pan,a:2=eks

cat ./output-reg-test/emitp1/out.ekswye
a:1=pan,a:2=eks,a:3=wye,a:4=eks
a:1=pan,a:2=eks,a:3=wye,a:4=eks

cat ./output-reg-test/emitp1/out.panpan
a:1=pan
a:1=pan

cat ./output-reg-test/emitp1/out.wyewye
a:1=pan,a:2=eks,a:3=wye
a:1=pan,a:2=eks,a:3=wye

mlr head -n 4 then put -q -o json @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp1/out.".$a.$b, @a ./reg-test/input/abixy

cat ./output-reg-test/emitp1/out.ekspan
{ "a": {"1": "pan", "2": "eks" } }

cat ./output-reg-test/emitp1/out.ekswye
{ "a": {"1": "pan", "2": "eks", "3": "wye", "4": "eks" } }

cat ./output-reg-test/emitp1/out.panpan
{ "a": {"1": "pan" } }

cat ./output-reg-test/emitp1/out.wyewye
{ "a": {"1": "pan", "2": "eks", "3": "wye" } }

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp | "tr \[a-z\] \[A-Z\]", @a ./reg-test/input/abixy
A:1=PAN
A:1=PAN,A:2=EKS
A:1=PAN,A:2=EKS,A:3=WYE
A:1=PAN,A:2=EKS,A:3=WYE,A:4=EKS

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stdout, @a ./reg-test/input/abixy
a:1=pan
a:1=pan,a:2=eks
a:1=pan,a:2=eks,a:3=wye
a:1=pan,a:2=eks,a:3=wye,a:4=eks

cat ./output-reg-test/emitp1/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stderr, @a ./reg-test/input/abixy

cat ./output-reg-test/emitp1/err2

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp2/out.".$a.$b, @a, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emitp2/out.ekspan
NR=1,a=pan
NR=2,a=eks

cat ./output-reg-test/emitp2/out.ekswye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks

cat ./output-reg-test/emitp2/out.panpan
NR=1,a=pan

cat ./output-reg-test/emitp2/out.wyewye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp2/out.".$a.$b, @a, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emitp2/out.ekspan
NR=1,a=pan
NR=2,a=eks

cat ./output-reg-test/emitp2/out.ekswye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks

cat ./output-reg-test/emitp2/out.panpan
NR=1,a=pan

cat ./output-reg-test/emitp2/out.wyewye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp >> "./output-reg-test/emitp2/out.".$a.$b, @a, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emitp2/out.ekspan
NR=1,a=pan
NR=2,a=eks
NR=1,a=pan
NR=2,a=eks

cat ./output-reg-test/emitp2/out.ekswye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks

cat ./output-reg-test/emitp2/out.panpan
NR=1,a=pan
NR=1,a=pan

cat ./output-reg-test/emitp2/out.wyewye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye

mlr head -n 4 then put -q -o json @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp2/out.".$a.$b, @a, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emitp2/out.ekspan
{ "NR": 1, "a": "pan" }
{ "NR": 2, "a": "eks" }

cat ./output-reg-test/emitp2/out.ekswye
{ "NR": 1, "a": "pan" }
{ "NR": 2, "a": "eks" }
{ "NR": 3, "a": "wye" }
{ "NR": 4, "a": "eks" }

cat ./output-reg-test/emitp2/out.panpan
{ "NR": 1, "a": "pan" }

cat ./output-reg-test/emitp2/out.wyewye
{ "NR": 1, "a": "pan" }
{ "NR": 2, "a": "eks" }
{ "NR": 3, "a": "wye" }

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp | "tr \[a-z\] \[A-Z\]", @a, "NR" ./reg-test/input/abixy
NR=1,A=PAN
NR=1,A=PAN
NR=2,A=EKS
NR=1,A=PAN
NR=2,A=EKS
NR=3,A=WYE
NR=1,A=PAN
NR=2,A=EKS
NR=3,A=WYE
NR=4,A=EKS

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stdout, @a, "NR" ./reg-test/input/abixy
NR=1,a=pan
NR=1,a=pan
NR=2,a=eks
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks

cat ./output-reg-test/emitp2/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stderr, @a, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emitp2/err2

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp3/out.".$a.$b, (@a, @b) ./reg-test/input/abixy

cat ./output-reg-test/emitp3/out.ekspan
a:1=pan,b:1=pan,a:2=eks,b:2=pan

cat ./output-reg-test/emitp3/out.ekswye
a:1=pan,b:1=pan,a:2=eks,b:2=pan,a:3=wye,b:3=wye,a:4=eks,b:4=wye

cat ./output-reg-test/emitp3/out.panpan
a:1=pan,b:1=pan

cat ./output-reg-test/emitp3/out.wyewye
a:1=pan,b:1=pan,a:2=eks,b:2=pan,a:3=wye,b:3=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp3/out.".$a.$b, (@a, @b) ./reg-test/input/abixy

cat ./output-reg-test/emitp3/out.ekspan
a:1=pan,b:1=pan,a:2=eks,b:2=pan

cat ./output-reg-test/emitp3/out.ekswye
a:1=pan,b:1=pan,a:2=eks,b:2=pan,a:3=wye,b:3=wye,a:4=eks,b:4=wye

cat ./output-reg-test/emitp3/out.panpan
a:1=pan,b:1=pan

cat ./output-reg-test/emitp3/out.wyewye
a:1=pan,b:1=pan,a:2=eks,b:2=pan,a:3=wye,b:3=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp >> "./output-reg-test/emitp3/out.".$a.$b, (@a, @b) ./reg-test/input/abixy

cat ./output-reg-test/emitp3/out.ekspan
a:1=pan,b:1=pan,a:2=eks,b:2=pan
a:1=pan,b:1=pan,a:2=eks,b:2=pan

cat ./output-reg-test/emitp3/out.ekswye
a:1=pan,b:1=pan,a:2=eks,b:2=pan,a:3=wye,b:3=wye,a:4=eks,b:4=wye
a:1=pan,b:1=pan,a:2=eks,b:2=pan,a:3=wye,b:3=wye,a:4=eks,b:4=wye

cat ./output-reg-test/emitp3/out.panpan
a:1=pan,b:1=pan
a:1=pan,b:1=pan

cat ./output-reg-test/emitp3/out.wyewye
a:1=pan,b:1=pan,a:2=eks,b:2=pan,a:3=wye,b:3=wye
a:1=pan,b:1=pan,a:2=eks,b:2=pan,a:3=wye,b:3=wye

mlr head -n 4 then put -q -o json @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp3/out.".$a.$b, (@a, @b) ./reg-test/input/abixy

cat ./output-reg-test/emitp3/out.ekspan
{ "a": {"1": "pan", "2": "eks" },"b": {"1": "pan", "2": "pan" } }

cat ./output-reg-test/emitp3/out.ekswye
{ "a": {"1": "pan", "2": "eks", "3": "wye", "4": "eks" },"b": {"1": "pan", "2": "pan", "3": "wye", "4": "wye" } }

cat ./output-reg-test/emitp3/out.panpan
{ "a": {"1": "pan" },"b": {"1": "pan" } }

cat ./output-reg-test/emitp3/out.wyewye
{ "a": {"1": "pan", "2": "eks", "3": "wye" },"b": {"1": "pan", "2": "pan", "3": "wye" } }

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp | "tr \[a-z\] \[A-Z\]", (@a, @b) ./reg-test/input/abixy
A:1=PAN,B:1=PAN
A:1=PAN,B:1=PAN,A:2=EKS,B:2=PAN
A:1=PAN,B:1=PAN,A:2=EKS,B:2=PAN,A:3=WYE,B:3=WYE
A:1=PAN,B:1=PAN,A:2=EKS,B:2=PAN,A:3=WYE,B:3=WYE,A:4=EKS,B:4=WYE

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stdout, (@a, @b) ./reg-test/input/abixy
a:1=pan,b:1=pan
a:1=pan,b:1=pan,a:2=eks,b:2=pan
a:1=pan,b:1=pan,a:2=eks,b:2=pan,a:3=wye,b:3=wye
a:1=pan,b:1=pan,a:2=eks,b:2=pan,a:3=wye,b:3=wye,a:4=eks,b:4=wye

cat ./output-reg-test/emitp3/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stderr, (@a, @b) ./reg-test/input/abixy

cat ./output-reg-test/emitp3/err2

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp4/out.".$a.$b, (@a, @b), "NR" ./reg-test/input/abixy

cat ./output-reg-test/emitp4/out.ekspan
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan

cat ./output-reg-test/emitp4/out.ekswye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye
NR=4,a=eks,b=wye

cat ./output-reg-test/emitp4/out.panpan
NR=1,a=pan,b=pan

cat ./output-reg-test/emitp4/out.wyewye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp4/out.".$a.$b, (@a, @b), "NR" ./reg-test/input/abixy

cat ./output-reg-test/emitp4/out.ekspan
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan

cat ./output-reg-test/emitp4/out.ekswye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye
NR=4,a=eks,b=wye

cat ./output-reg-test/emitp4/out.panpan
NR=1,a=pan,b=pan

cat ./output-reg-test/emitp4/out.wyewye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp >> "./output-reg-test/emitp4/out.".$a.$b, (@a, @b), "NR" ./reg-test/input/abixy

cat ./output-reg-test/emitp4/out.ekspan
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan

cat ./output-reg-test/emitp4/out.ekswye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye
NR=4,a=eks,b=wye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye
NR=4,a=eks,b=wye

cat ./output-reg-test/emitp4/out.panpan
NR=1,a=pan,b=pan
NR=1,a=pan,b=pan

cat ./output-reg-test/emitp4/out.wyewye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye

mlr head -n 4 then put -q -o json @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp4/out.".$a.$b, (@a, @b), "NR" ./reg-test/input/abixy

cat ./output-reg-test/emitp4/out.ekspan
{ "NR": 1, "a": "pan", "b": "pan" }
{ "NR": 2, "a": "eks", "b": "pan" }

cat ./output-reg-test/emitp4/out.ekswye
{ "NR": 1, "a": "pan", "b": "pan" }
{ "NR": 2, "a": "eks", "b": "pan" }
{ "NR": 3, "a": "wye", "b": "wye" }
{ "NR": 4, "a": "eks", "b": "wye" }

cat ./output-reg-test/emitp4/out.panpan
{ "NR": 1, "a": "pan", "b": "pan" }

cat ./output-reg-test/emitp4/out.wyewye
{ "NR": 1, "a": "pan", "b": "pan" }
{ "NR": 2, "a": "eks", "b": "pan" }
{ "NR": 3, "a": "wye", "b": "wye" }

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp | "tr \[a-z\] \[A-Z\]", (@a, @b), "NR" ./reg-test/input/abixy
NR=1,A=PAN,B=PAN
NR=1,A=PAN,B=PAN
NR=2,A=EKS,B=PAN
NR=1,A=PAN,B=PAN
NR=2,A=EKS,B=PAN
NR=3,A=WYE,B=WYE
NR=1,A=PAN,B=PAN
NR=2,A=EKS,B=PAN
NR=3,A=WYE,B=WYE
NR=4,A=EKS,B=WYE

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stdout, (@a, @b), "NR" ./reg-test/input/abixy
NR=1,a=pan,b=pan
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye
NR=4,a=eks,b=wye

cat ./output-reg-test/emitp4/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stderr, (@a, @b), "NR" ./reg-test/input/abixy

cat ./output-reg-test/emitp4/err2

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp5/out.".$a.$b, @* ./reg-test/input/abixy

cat ./output-reg-test/emitp5/out.ekspan
a:1=pan,a:2=eks
b:1=pan,b:2=pan

cat ./output-reg-test/emitp5/out.ekswye
a:1=pan,a:2=eks,a:3=wye,a:4=eks
b:1=pan,b:2=pan,b:3=wye,b:4=wye

cat ./output-reg-test/emitp5/out.panpan
a:1=pan
b:1=pan

cat ./output-reg-test/emitp5/out.wyewye
a:1=pan,a:2=eks,a:3=wye
b:1=pan,b:2=pan,b:3=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp | "tr \[a-z\] \[A-Z\]", @* ./reg-test/input/abixy
A:1=PAN
B:1=PAN
A:1=PAN,A:2=EKS
B:1=PAN,B:2=PAN
A:1=PAN,A:2=EKS,A:3=WYE
B:1=PAN,B:2=PAN,B:3=WYE
A:1=PAN,A:2=EKS,A:3=WYE,A:4=EKS
B:1=PAN,B:2=PAN,B:3=WYE,B:4=WYE

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stdout, @* ./reg-test/input/abixy
a:1=pan
b:1=pan
a:1=pan,a:2=eks
b:1=pan,b:2=pan
a:1=pan,a:2=eks,a:3=wye
b:1=pan,b:2=pan,b:3=wye
a:1=pan,a:2=eks,a:3=wye,a:4=eks
b:1=pan,b:2=pan,b:3=wye,b:4=wye

cat ./output-reg-test/emitp5/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stderr, @* ./reg-test/input/abixy

cat ./output-reg-test/emitp5/err2

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp6/out.".$a.$b, all ./reg-test/input/abixy

cat ./output-reg-test/emitp6/out.ekspan
a:1=pan,a:2=eks
b:1=pan,b:2=pan

cat ./output-reg-test/emitp6/out.ekswye
a:1=pan,a:2=eks,a:3=wye,a:4=eks
b:1=pan,b:2=pan,b:3=wye,b:4=wye

cat ./output-reg-test/emitp6/out.panpan
a:1=pan
b:1=pan

cat ./output-reg-test/emitp6/out.wyewye
a:1=pan,a:2=eks,a:3=wye
b:1=pan,b:2=pan,b:3=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp | "tr \[a-z\] \[A-Z\]", all ./reg-test/input/abixy
A:1=PAN
B:1=PAN
A:1=PAN,A:2=EKS
B:1=PAN,B:2=PAN
A:1=PAN,A:2=EKS,A:3=WYE
B:1=PAN,B:2=PAN,B:3=WYE
A:1=PAN,A:2=EKS,A:3=WYE,A:4=EKS
B:1=PAN,B:2=PAN,B:3=WYE,B:4=WYE

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stdout, all ./reg-test/input/abixy
a:1=pan
b:1=pan
a:1=pan,a:2=eks
b:1=pan,b:2=pan
a:1=pan,a:2=eks,a:3=wye
b:1=pan,b:2=pan,b:3=wye
a:1=pan,a:2=eks,a:3=wye,a:4=eks
b:1=pan,b:2=pan,b:3=wye,b:4=wye

cat ./output-reg-test/emitp6/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stderr, all ./reg-test/input/abixy

cat ./output-reg-test/emitp6/err2

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp7/out.".$a.$b, @*, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emitp7/out.ekspan
NR=1,a=pan
NR=2,a=eks
NR=1,b=pan
NR=2,b=pan

cat ./output-reg-test/emitp7/out.ekswye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye
NR=4,b=wye

cat ./output-reg-test/emitp7/out.panpan
NR=1,a=pan
NR=1,b=pan

cat ./output-reg-test/emitp7/out.wyewye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp | "tr \[a-z\] \[A-Z\]", @*, "NR" ./reg-test/input/abixy
NR=1,A=PAN
NR=1,B=PAN
NR=1,A=PAN
NR=2,A=EKS
NR=1,B=PAN
NR=2,B=PAN
NR=1,A=PAN
NR=2,A=EKS
NR=3,A=WYE
NR=1,B=PAN
NR=2,B=PAN
NR=3,B=WYE
NR=1,A=PAN
NR=2,A=EKS
NR=3,A=WYE
NR=4,A=EKS
NR=1,B=PAN
NR=2,B=PAN
NR=3,B=WYE
NR=4,B=WYE

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stdout, @*, "NR" ./reg-test/input/abixy
NR=1,a=pan
NR=1,b=pan
NR=1,a=pan
NR=2,a=eks
NR=1,b=pan
NR=2,b=pan
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye
NR=4,b=wye

cat ./output-reg-test/emitp7/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stderr, @*, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emitp7/err2

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > "./output-reg-test/emitp8/out.".$a.$b, all, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emitp8/out.ekspan
NR=1,a=pan
NR=2,a=eks
NR=1,b=pan
NR=2,b=pan

cat ./output-reg-test/emitp8/out.ekswye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye
NR=4,b=wye

cat ./output-reg-test/emitp8/out.panpan
NR=1,a=pan
NR=1,b=pan

cat ./output-reg-test/emitp8/out.wyewye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp | "tr \[a-z\] \[A-Z\]", all, "NR" ./reg-test/input/abixy
NR=1,A=PAN
NR=1,B=PAN
NR=1,A=PAN
NR=2,A=EKS
NR=1,B=PAN
NR=2,B=PAN
NR=1,A=PAN
NR=2,A=EKS
NR=3,A=WYE
NR=1,B=PAN
NR=2,B=PAN
NR=3,B=WYE
NR=1,A=PAN
NR=2,A=EKS
NR=3,A=WYE
NR=4,A=EKS
NR=1,B=PAN
NR=2,B=PAN
NR=3,B=WYE
NR=4,B=WYE

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stdout, all, "NR" ./reg-test/input/abixy
NR=1,a=pan
NR=1,b=pan
NR=1,a=pan
NR=2,a=eks
NR=1,b=pan
NR=2,b=pan
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye
NR=4,b=wye

cat ./output-reg-test/emitp8/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emitp > stderr, all, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emitp8/err2


================================================================
DSL EMIT REDIRECTS

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit1/out.".$a.$b, @a ./reg-test/input/abixy

cat ./output-reg-test/emit1/out.ekspan
1=pan,2=eks

cat ./output-reg-test/emit1/out.ekswye
1=pan,2=eks,3=wye,4=eks

cat ./output-reg-test/emit1/out.panpan
1=pan

cat ./output-reg-test/emit1/out.wyewye
1=pan,2=eks,3=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit1/out.".$a.$b, @a ./reg-test/input/abixy

cat ./output-reg-test/emit1/out.ekspan
1=pan,2=eks

cat ./output-reg-test/emit1/out.ekswye
1=pan,2=eks,3=wye,4=eks

cat ./output-reg-test/emit1/out.panpan
1=pan

cat ./output-reg-test/emit1/out.wyewye
1=pan,2=eks,3=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit >> "./output-reg-test/emit1/out.".$a.$b, @a ./reg-test/input/abixy

cat ./output-reg-test/emit1/out.ekspan
1=pan,2=eks
1=pan,2=eks

cat ./output-reg-test/emit1/out.ekswye
1=pan,2=eks,3=wye,4=eks
1=pan,2=eks,3=wye,4=eks

cat ./output-reg-test/emit1/out.panpan
1=pan
1=pan

cat ./output-reg-test/emit1/out.wyewye
1=pan,2=eks,3=wye
1=pan,2=eks,3=wye

mlr head -n 4 then put -q -o json @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit1/out.".$a.$b, @a ./reg-test/input/abixy

cat ./output-reg-test/emit1/out.ekspan
{ "1": "pan", "2": "eks" }

cat ./output-reg-test/emit1/out.ekswye
{ "1": "pan", "2": "eks", "3": "wye", "4": "eks" }

cat ./output-reg-test/emit1/out.panpan
{ "1": "pan" }

cat ./output-reg-test/emit1/out.wyewye
{ "1": "pan", "2": "eks", "3": "wye" }

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit | "tr \[a-z\] \[A-Z\]", @a ./reg-test/input/abixy
1=PAN
1=PAN,2=EKS
1=PAN,2=EKS,3=WYE
1=PAN,2=EKS,3=WYE,4=EKS

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stdout, @a ./reg-test/input/abixy
1=pan
1=pan,2=eks
1=pan,2=eks,3=wye
1=pan,2=eks,3=wye,4=eks

cat ./output-reg-test/emit1/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stderr, @a ./reg-test/input/abixy

cat ./output-reg-test/emit1/err2

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit2/out.".$a.$b, @a, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit2/out.ekspan
NR=1,a=pan
NR=2,a=eks

cat ./output-reg-test/emit2/out.ekswye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks

cat ./output-reg-test/emit2/out.panpan
NR=1,a=pan

cat ./output-reg-test/emit2/out.wyewye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit2/out.".$a.$b, @a, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit2/out.ekspan
NR=1,a=pan
NR=2,a=eks

cat ./output-reg-test/emit2/out.ekswye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks

cat ./output-reg-test/emit2/out.panpan
NR=1,a=pan

cat ./output-reg-test/emit2/out.wyewye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit >> "./output-reg-test/emit2/out.".$a.$b, @a, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit2/out.ekspan
NR=1,a=pan
NR=2,a=eks
NR=1,a=pan
NR=2,a=eks

cat ./output-reg-test/emit2/out.ekswye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks

cat ./output-reg-test/emit2/out.panpan
NR=1,a=pan
NR=1,a=pan

cat ./output-reg-test/emit2/out.wyewye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye

mlr head -n 4 then put -q -o pprint @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit2/out.".$a.$b, @a, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit2/out.ekspan
NR a
1  pan
2  eks

cat ./output-reg-test/emit2/out.ekswye
NR a
1  pan
2  eks
3  wye
4  eks

cat ./output-reg-test/emit2/out.panpan
NR a
1  pan

cat ./output-reg-test/emit2/out.wyewye
NR a
1  pan
2  eks
3  wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit | "tr \[a-z\] \[A-Z\]", @a, "NR" ./reg-test/input/abixy
NR=1,A=PAN
NR=1,A=PAN
NR=2,A=EKS
NR=1,A=PAN
NR=2,A=EKS
NR=3,A=WYE
NR=1,A=PAN
NR=2,A=EKS
NR=3,A=WYE
NR=4,A=EKS

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stdout, @a, "NR" ./reg-test/input/abixy
NR=1,a=pan
NR=1,a=pan
NR=2,a=eks
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks

cat ./output-reg-test/emit2/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stderr, @a, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit2/err2

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit3/out.".$a.$b, (@a, @b) ./reg-test/input/abixy

cat ./output-reg-test/emit3/out.ekspan
1=pan,2=pan

cat ./output-reg-test/emit3/out.ekswye
1=pan,2=pan,3=wye,4=wye

cat ./output-reg-test/emit3/out.panpan
1=pan

cat ./output-reg-test/emit3/out.wyewye
1=pan,2=pan,3=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit3/out.".$a.$b, (@a, @b) ./reg-test/input/abixy

cat ./output-reg-test/emit3/out.ekspan
1=pan,2=pan

cat ./output-reg-test/emit3/out.ekswye
1=pan,2=pan,3=wye,4=wye

cat ./output-reg-test/emit3/out.panpan
1=pan

cat ./output-reg-test/emit3/out.wyewye
1=pan,2=pan,3=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit >> "./output-reg-test/emit3/out.".$a.$b, (@a, @b) ./reg-test/input/abixy

cat ./output-reg-test/emit3/out.ekspan
1=pan,2=pan
1=pan,2=pan

cat ./output-reg-test/emit3/out.ekswye
1=pan,2=pan,3=wye,4=wye
1=pan,2=pan,3=wye,4=wye

cat ./output-reg-test/emit3/out.panpan
1=pan
1=pan

cat ./output-reg-test/emit3/out.wyewye
1=pan,2=pan,3=wye
1=pan,2=pan,3=wye

mlr head -n 4 then put -q --oxtab @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit3/out.".$a.$b, (@a, @b) ./reg-test/input/abixy

cat ./output-reg-test/emit3/out.ekspan
1 pan
2 pan

cat ./output-reg-test/emit3/out.ekswye
1 pan
2 pan
3 wye
4 wye

cat ./output-reg-test/emit3/out.panpan
1 pan

cat ./output-reg-test/emit3/out.wyewye
1 pan
2 pan
3 wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit | "tr \[a-z\] \[A-Z\]", (@a, @b) ./reg-test/input/abixy
1=PAN
1=PAN,2=PAN
1=PAN,2=PAN,3=WYE
1=PAN,2=PAN,3=WYE,4=WYE

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stdout, (@a, @b) ./reg-test/input/abixy
1=pan
1=pan,2=pan
1=pan,2=pan,3=wye
1=pan,2=pan,3=wye,4=wye

cat ./output-reg-test/emit3/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stderr, (@a, @b) ./reg-test/input/abixy

cat ./output-reg-test/emit3/err2

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit4/out.".$a.$b, (@a, @b), "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit4/out.ekspan
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan

cat ./output-reg-test/emit4/out.ekswye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye
NR=4,a=eks,b=wye

cat ./output-reg-test/emit4/out.panpan
NR=1,a=pan,b=pan

cat ./output-reg-test/emit4/out.wyewye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit4/out.".$a.$b, (@a, @b), "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit4/out.ekspan
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan

cat ./output-reg-test/emit4/out.ekswye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye
NR=4,a=eks,b=wye

cat ./output-reg-test/emit4/out.panpan
NR=1,a=pan,b=pan

cat ./output-reg-test/emit4/out.wyewye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit >> "./output-reg-test/emit4/out.".$a.$b, (@a, @b), "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit4/out.ekspan
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan

cat ./output-reg-test/emit4/out.ekswye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye
NR=4,a=eks,b=wye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye
NR=4,a=eks,b=wye

cat ./output-reg-test/emit4/out.panpan
NR=1,a=pan,b=pan
NR=1,a=pan,b=pan

cat ./output-reg-test/emit4/out.wyewye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye

mlr head -n 4 then put -q --ojson @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit4/out.".$a.$b, (@a, @b), "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit4/out.ekspan
{ "NR": 1, "a": "pan", "b": "pan" }
{ "NR": 2, "a": "eks", "b": "pan" }

cat ./output-reg-test/emit4/out.ekswye
{ "NR": 1, "a": "pan", "b": "pan" }
{ "NR": 2, "a": "eks", "b": "pan" }
{ "NR": 3, "a": "wye", "b": "wye" }
{ "NR": 4, "a": "eks", "b": "wye" }

cat ./output-reg-test/emit4/out.panpan
{ "NR": 1, "a": "pan", "b": "pan" }

cat ./output-reg-test/emit4/out.wyewye
{ "NR": 1, "a": "pan", "b": "pan" }
{ "NR": 2, "a": "eks", "b": "pan" }
{ "NR": 3, "a": "wye", "b": "wye" }

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit | "tr \[a-z\] \[A-Z\]", (@a, @b), "NR" ./reg-test/input/abixy
NR=1,A=PAN,B=PAN
NR=1,A=PAN,B=PAN
NR=2,A=EKS,B=PAN
NR=1,A=PAN,B=PAN
NR=2,A=EKS,B=PAN
NR=3,A=WYE,B=WYE
NR=1,A=PAN,B=PAN
NR=2,A=EKS,B=PAN
NR=3,A=WYE,B=WYE
NR=4,A=EKS,B=WYE

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stdout, (@a, @b), "NR" ./reg-test/input/abixy
NR=1,a=pan,b=pan
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye
NR=1,a=pan,b=pan
NR=2,a=eks,b=pan
NR=3,a=wye,b=wye
NR=4,a=eks,b=wye

cat ./output-reg-test/emit4/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stderr, (@a, @b), "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit4/err2

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit5/out.".$a.$b, @* ./reg-test/input/abixy

cat ./output-reg-test/emit5/out.ekspan
1=pan,2=eks
1=pan,2=pan

cat ./output-reg-test/emit5/out.ekswye
1=pan,2=eks,3=wye,4=eks
1=pan,2=pan,3=wye,4=wye

cat ./output-reg-test/emit5/out.panpan
1=pan
1=pan

cat ./output-reg-test/emit5/out.wyewye
1=pan,2=eks,3=wye
1=pan,2=pan,3=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit | "tr \[a-z\] \[A-Z\]", @* ./reg-test/input/abixy
1=PAN
1=PAN
1=PAN,2=EKS
1=PAN,2=PAN
1=PAN,2=EKS,3=WYE
1=PAN,2=PAN,3=WYE
1=PAN,2=EKS,3=WYE,4=EKS
1=PAN,2=PAN,3=WYE,4=WYE

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stdout, @* ./reg-test/input/abixy
1=pan
1=pan
1=pan,2=eks
1=pan,2=pan
1=pan,2=eks,3=wye
1=pan,2=pan,3=wye
1=pan,2=eks,3=wye,4=eks
1=pan,2=pan,3=wye,4=wye

cat ./output-reg-test/emit5/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stderr, @* ./reg-test/input/abixy

cat ./output-reg-test/emit5/err2

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit6/out.".$a.$b, all ./reg-test/input/abixy

cat ./output-reg-test/emit6/out.ekspan
1=pan,2=eks
1=pan,2=pan

cat ./output-reg-test/emit6/out.ekswye
1=pan,2=eks,3=wye,4=eks
1=pan,2=pan,3=wye,4=wye

cat ./output-reg-test/emit6/out.panpan
1=pan
1=pan

cat ./output-reg-test/emit6/out.wyewye
1=pan,2=eks,3=wye
1=pan,2=pan,3=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit | "tr \[a-z\] \[A-Z\]", all ./reg-test/input/abixy
1=PAN
1=PAN
1=PAN,2=EKS
1=PAN,2=PAN
1=PAN,2=EKS,3=WYE
1=PAN,2=PAN,3=WYE
1=PAN,2=EKS,3=WYE,4=EKS
1=PAN,2=PAN,3=WYE,4=WYE

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stdout, all ./reg-test/input/abixy
1=pan
1=pan
1=pan,2=eks
1=pan,2=pan
1=pan,2=eks,3=wye
1=pan,2=pan,3=wye
1=pan,2=eks,3=wye,4=eks
1=pan,2=pan,3=wye,4=wye

cat ./output-reg-test/emit6/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stderr, all ./reg-test/input/abixy

cat ./output-reg-test/emit6/err2

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit7/out.".$a.$b, @*, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit7/out.ekspan
NR=1,a=pan
NR=2,a=eks
NR=1,b=pan
NR=2,b=pan

cat ./output-reg-test/emit7/out.ekswye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye
NR=4,b=wye

cat ./output-reg-test/emit7/out.panpan
NR=1,a=pan
NR=1,b=pan

cat ./output-reg-test/emit7/out.wyewye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit | "tr \[a-z\] \[A-Z\]", @*, "NR" ./reg-test/input/abixy
NR=1,A=PAN
NR=1,B=PAN
NR=1,A=PAN
NR=2,A=EKS
NR=1,B=PAN
NR=2,B=PAN
NR=1,A=PAN
NR=2,A=EKS
NR=3,A=WYE
NR=1,B=PAN
NR=2,B=PAN
NR=3,B=WYE
NR=1,A=PAN
NR=2,A=EKS
NR=3,A=WYE
NR=4,A=EKS
NR=1,B=PAN
NR=2,B=PAN
NR=3,B=WYE
NR=4,B=WYE

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stdout, @*, "NR" ./reg-test/input/abixy
NR=1,a=pan
NR=1,b=pan
NR=1,a=pan
NR=2,a=eks
NR=1,b=pan
NR=2,b=pan
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye
NR=4,b=wye

cat ./output-reg-test/emit7/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stderr, @*, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit7/err2

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > "./output-reg-test/emit8/out.".$a.$b, all, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit8/out.ekspan
NR=1,a=pan
NR=2,a=eks
NR=1,b=pan
NR=2,b=pan

cat ./output-reg-test/emit8/out.ekswye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye
NR=4,b=wye

cat ./output-reg-test/emit8/out.panpan
NR=1,a=pan
NR=1,b=pan

cat ./output-reg-test/emit8/out.wyewye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit | "tr \[a-z\] \[A-Z\]", all, "NR" ./reg-test/input/abixy
NR=1,A=PAN
NR=1,B=PAN
NR=1,A=PAN
NR=2,A=EKS
NR=1,B=PAN
NR=2,B=PAN
NR=1,A=PAN
NR=2,A=EKS
NR=3,A=WYE
NR=1,B=PAN
NR=2,B=PAN
NR=3,B=WYE
NR=1,A=PAN
NR=2,A=EKS
NR=3,A=WYE
NR=4,A=EKS
NR=1,B=PAN
NR=2,B=PAN
NR=3,B=WYE
NR=4,B=WYE

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stdout, all, "NR" ./reg-test/input/abixy
NR=1,a=pan
NR=1,b=pan
NR=1,a=pan
NR=2,a=eks
NR=1,b=pan
NR=2,b=pan
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye
NR=1,a=pan
NR=2,a=eks
NR=3,a=wye
NR=4,a=eks
NR=1,b=pan
NR=2,b=pan
NR=3,b=wye
NR=4,b=wye

cat ./output-reg-test/emit8/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stderr, all, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit8/err2

mlr head -n 4 then put -q emit > "./output-reg-test/emit9/out.".$a.$b, $* ./reg-test/input/abixy

cat ./output-reg-test/emit9/out.ekspan
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797

cat ./output-reg-test/emit9/out.ekswye
a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463

cat ./output-reg-test/emit9/out.panpan
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533

cat ./output-reg-test/emit9/out.wyewye
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit | "tr \[a-z\] \[A-Z\]", $*, "NR" ./reg-test/input/abixy
A=PAN,B=PAN,I=1,X=0.3467901443380824,Y=0.7268028627434533
A=EKS,B=PAN,I=2,X=0.7586799647899636,Y=0.5221511083334797
A=WYE,B=WYE,I=3,X=0.20460330576630303,Y=0.33831852551664776
A=EKS,B=WYE,I=4,X=0.38139939387114097,Y=0.13418874328430463

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stdout, $*, "NR" ./reg-test/input/abixy
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463

cat ./output-reg-test/emit9/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stderr, $*, "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit9/err2

mlr head -n 4 then put -q emit > "./output-reg-test/emit10/out.".$a.$b, mapexcept($*, "a", "b") ./reg-test/input/abixy

cat ./output-reg-test/emit10/out.ekspan
i=2,x=0.7586799647899636,y=0.5221511083334797

cat ./output-reg-test/emit10/out.ekswye
i=4,x=0.38139939387114097,y=0.13418874328430463

cat ./output-reg-test/emit10/out.panpan
i=1,x=0.3467901443380824,y=0.7268028627434533

cat ./output-reg-test/emit10/out.wyewye
i=3,x=0.20460330576630303,y=0.33831852551664776

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit | "tr \[a-z\] \[A-Z\]", mapexcept($*, "a", "b"), "NR" ./reg-test/input/abixy
NR=I,_=1
NR=X,_=0.3467901443380824
NR=Y,_=0.7268028627434533
NR=I,_=2
NR=X,_=0.7586799647899636
NR=Y,_=0.5221511083334797
NR=I,_=3
NR=X,_=0.20460330576630303
NR=Y,_=0.33831852551664776
NR=I,_=4
NR=X,_=0.38139939387114097
NR=Y,_=0.13418874328430463

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stdout, mapexcept($*, "a", "b"), "NR" ./reg-test/input/abixy
NR=i,_=1
NR=x,_=0.3467901443380824
NR=y,_=0.7268028627434533
NR=i,_=2
NR=x,_=0.7586799647899636
NR=y,_=0.5221511083334797
NR=i,_=3
NR=x,_=0.20460330576630303
NR=y,_=0.33831852551664776
NR=i,_=4
NR=x,_=0.38139939387114097
NR=y,_=0.13418874328430463

cat ./output-reg-test/emit10/err1

mlr head -n 4 then put -q @a[NR]=$a; @b[NR]=$b; emit > stderr, mapexcept($*, "a", "b"), "NR" ./reg-test/input/abixy

cat ./output-reg-test/emit10/err2

