diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-03-02 10:22:13 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-03-02 10:22:13 +1300 |
commit | 4b100ba2f7f2190f80cff643cc171b599b6a5009 (patch) | |
tree | 5786d3e29b503a1814ae149a324701dbc20408d7 | |
parent | Unsigned integers for printf (diff) | |
download | dotfiles-4b100ba2f7f2190f80cff643cc171b599b6a5009.tar.gz dotfiles-4b100ba2f7f2190f80cff643cc171b599b6a5009.zip |
Add clwr() func
-rw-r--r-- | bash/bashrc.d/clwr.bash | 9 |
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 +} + |