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:
parent
7b2856ddff
commit
2fa5caa586
1 changed files with 10 additions and 0 deletions
10
stdlib-candidate/null-stream.nu
Normal file
10
stdlib-candidate/null-stream.nu
Normal 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"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue