From 7c1dcc030d1aa3f5f000be34e1b5072487fb6d0d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 23 Jul 2015 14:46:32 +1200 Subject: Add pan func ; print args with null delimiter --- README.markdown | 1 + bash/bashrc.d/pan.bash | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 bash/bashrc.d/pan.bash diff --git a/README.markdown b/README.markdown index 9bfce28e..0ec67b44 100644 --- a/README.markdown +++ b/README.markdown @@ -184,6 +184,7 @@ There are a few other little tricks in `bash/bashrc.d`, including: * `mkcp` — Create a directory and copy arguments into it * `mkmv` — Create a directory and move arguments into it * `pa` — Print given arguments, one per line +* `pan` — Print given arguments separated by NULL chars * `path` — Manage the contents of `PATH` conveniently * `pd` — Change to the argument’s parent directory * `scr` — Create a temporary directory and change into it diff --git a/bash/bashrc.d/pan.bash b/bash/bashrc.d/pan.bash new file mode 100644 index 00000000..14cd3625 --- /dev/null +++ b/bash/bashrc.d/pan.bash @@ -0,0 +1,6 @@ +# Print arguments, null-delimited; you will probably want to write this into a +# file or as part of a pipeline +pan() { + printf '%s\0' "$@" +} + -- cgit v1.2.3