diff --git a/stdlib-candidate/null-stream.nu b/stdlib-candidate/null-stream.nu new file mode 100644 index 00000000..224f036c --- /dev/null +++ b/stdlib-candidate/null-stream.nu @@ -0,0 +1,10 @@ +# Examples +# redirect to the null stream +# > echo foo out> (null-stream) +def null-stream []: nothing -> string { + if $nu.os-info.name == "windows" { + "NUL:" + } else { + "/dev/null" + } +}