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.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/eprintf.nix b/tools/eprintf.nix
new file mode 100644
index 000000000000..eeacca4c8c72
--- /dev/null
+++ b/tools/eprintf.nix
@@ -0,0 +1,9 @@
+{ 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 "$@"
+]