about summary refs log tree commit diff
path: root/tools/eprintf.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eprintf.nix')
-rw-r--r--tools/eprintf.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/eprintf.nix b/tools/eprintf.nix
new file mode 100644
index 000000000000..933d73ea71ae
--- /dev/null
+++ b/tools/eprintf.nix
@@ -0,0 +1,15 @@
+{ depot, pkgs, ... }:
+
+let
+  bins = depot.nix.getBins pkgs.coreutils [ "printf" ];
+
+  # printf(1), but redirect to stderr
+in
+depot.nix.writeExecline "eprintf" { } [
+  "fdmove"
+  "-c"
+  "1"
+  "2"
+  bins.printf
+  "$@"
+]