How to force legend only write specification file in modern style

Sorry, a further topic. When working with legend in modern style, I can generate different symbol meanings automatically through the -l flag in gmt plot; great feature. But if I want to change the appearance of the legend further I get some trouble.

begin gmt
gmt basemap -JX10/7 -R0/6/-15/1 -Bxa5f1+l"Distance from load centre"+u"\260" -Bya5f1+l"Vertical displacement (m)" -BWSne
cat a1.dat | gmt plot -JX -Wthin,grey -l"t2 n512 j170"+H"Model"+f"12p,Helvetica-Bold" # to specify legend’s header and header-font
cat a2.dat | gmt plot -JX -Wthin,red -l"t2 n512 j340"
cat a3.dat | gmt plot -JX -Wthick,purple,- -l"t1 tefe j1024"
gmt legend -DjBR+o0.5c -F+gwhite+pthick -S1.3 --FONT_ANNOT_PRIMARY=10p,Helvetica -Tleg.txt
cat leg.txt > legend.txt
echo “D 0.2i 1p” >> legend.txt # a dummy example
gmt legend -DjBR+o0.5c -F+gwhite+pthick -S1.3 --FONT_ANNOT_PRIMARY=10p,Helvetica legend.txt
end gmt

In this case both gmt commands plot a legend one onto the other, which has the disadvantage that the second legend command has to generate a legend larger than the first one, and the background (-F+g) cannot be transparent. So, a simple solution is possible, but let the first legend command write to /dev/null would be more consistent. Is there such a feature or a work around in modern-style gmt ?