aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.markdown1
-rw-r--r--bash/bashrc.d/readz.bash5
2 files changed, 6 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index 497d5fe5..2f5c209b 100644
--- a/README.markdown
+++ b/README.markdown
@@ -187,6 +187,7 @@ There are a few other little tricks in `bash/bashrc.d`, including:
* `paz` — Print given arguments separated by NULL chars
* `path` — Manage the contents of `PATH` conveniently
* `pd` — Change to the argument’s parent directory
+* `readz` — Alias for `read -d '' -r`
* `scr` — Create a temporary directory and change into it
* `sprunge` — Pastebin frontend tool I pilfered from `#bash` on Freenode
* `ud` — Change into an indexed ancestor of a directory
diff --git a/bash/bashrc.d/readz.bash b/bash/bashrc.d/readz.bash
new file mode 100644
index 00000000..4b35979c
--- /dev/null
+++ b/bash/bashrc.d/readz.bash
@@ -0,0 +1,5 @@
+# Call read with a null delimiter
+readz() {
+ builtin read -d '' -r "$@"
+}
+