]> git.armaanb.net Git - bin.git/commitdiff
inp: add script
authorArmaan Bhojwani <me@armaanb.net>
Mon, 5 Jul 2021 17:09:33 +0000 (13:09 -0400)
committerArmaan Bhojwani <me@armaanb.net>
Mon, 5 Jul 2021 17:09:33 +0000 (13:09 -0400)
inp [new file with mode: 0755]
man/inp.1.scd [new file with mode: 0644]

diff --git a/inp b/inp
new file mode 100755 (executable)
index 0000000..04b96cf
--- /dev/null
+++ b/inp
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+
+"$1" "$2" > "${2}.tmp"
+mv "${2}.tmp" "$2"
diff --git a/man/inp.1.scd b/man/inp.1.scd
new file mode 100644 (file)
index 0000000..2f468fd
--- /dev/null
@@ -0,0 +1,17 @@
+fmt-music(1)
+
+# NAME
+inp - run any command in-place.
+
+# SYNOPSIS
+*inp* [command] [input file]
+
+# DESCRIPTION
+Run any command that outputs to stdout in place. For example to run fold on   
+file you could run "inp 'fold -s -w 72' file.txt". It is important that the 
+command and all of its options are a single argument, wrapped in quotes if need 
+be.
+
+# COPYRIGHT
+This is free and unencumbered software released into the public domain. For more
+information, please refer to <https://unlicense.org/>.
\ No newline at end of file