miller icon indicating copy to clipboard operation
miller copied to clipboard

How to exit like awk?

Open amitbha opened this issue 5 years ago • 2 comments

I want to exit miller in some conditions, without processing remaining records. Just like awk's exit statement. ex. mlr put 'if ($month < 5) { exit 0 }; ....' Not found in document.

The Assertions could be a alternative to exit, but they only support type-check, not value.

amitbha avatar Jun 22 '20 02:06 amitbha

Should we still execute the end blocks (if any) in the put statement? For example if there are 1000 records in the input data and you did exit(0) on the 17th one.

johnkerl avatar Aug 19 '20 15:08 johnkerl

... aha, it should be awk-like in this regard too :)

https://www.gnu.org/software/gawk/manual/html_node/Exit-Statement.html

johnkerl avatar Aug 20 '20 03:08 johnkerl