1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00

null-stream.nu as stdlib-candidate (#649)

This is a way to redirect to a null stream with the same syntax
regardless of platform.
This commit is contained in:
Hullabaloo-and-Howdy-Do 2023-10-23 10:57:50 -05:00 committed by GitHub
parent 7b2856ddff
commit 2fa5caa586
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"
}
}