aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-03-02 10:22:13 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-03-02 10:22:13 +1300
commit4b100ba2f7f2190f80cff643cc171b599b6a5009 (patch)
tree5786d3e29b503a1814ae149a324701dbc20408d7 /bash
parentUnsigned integers for printf (diff)
downloaddotfiles-4b100ba2f7f2190f80cff643cc171b599b6a5009.tar.gz
dotfiles-4b100ba2f7f2190f80cff643cc171b599b6a5009.zip
Add clwr() func
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc.d/clwr.bash9
1 files changed, 9 insertions, 0 deletions
diff --git a/bash/bashrc.d/clwr.bash b/bash/bashrc.d/clwr.bash
new file mode 100644
index 00000000..a12ced4c
--- /dev/null
+++ b/bash/bashrc.d/clwr.bash
@@ -0,0 +1,9 @@
+# Clear screen, accept line, write to all args, loop; use this as e.g. an input
+# tmux window for a minimal IRC client like ii(1). Uses read -e to allow
+# newlines.
+clwr() {
+ while { clear && IFS= read -er line ; } ; do
+ printf '%s\n' "$line"
+ done
+}
+