in reply to Re: clobbering output
in thread clobbering output

This meets the problem statement, no question.

But I have an issue with the problem statement itself. I don't use a real shebang line. Instead, my "shebang" line is this instead:

eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}' && eval 'exec perl -w -S $0 $argv:q' if 0; # The above invocation finds perl in the path, wherever it may be
So fortunately the original problem statement doesn't break it, nor does the intended solution do what it's supposed to.

This probably isn't the place to discuss the merits of a real shebang line, but I'll mention one point anyway. My *nix home directory is automounted on countless network machines, and I don't have the time to manage $PATH on every one, etc.

Unless there is a more elegant way than this, I'll do without a shebang.

-QM
--
Quantum Mechanics: The dreams stuff is made of