aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-07-23 14:49:35 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-07-23 14:49:35 +1200
commit24d8c07c007cd85e3407118e351c82291fa87e37 (patch)
tree17ca3070c1f8483c34e78b0356167eeaca8b9bbd /bash/bashrc.d
parentAdd pan func ; print args with null delimiter (diff)
downloaddotfiles-24d8c07c007cd85e3407118e351c82291fa87e37.tar.gz
dotfiles-24d8c07c007cd85e3407118e351c82291fa87e37.zip
More detail for pa() and pan() funcs
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/pa.bash2
-rw-r--r--bash/bashrc.d/pan.bash6
2 files changed, 5 insertions, 3 deletions
diff --git a/bash/bashrc.d/pa.bash b/bash/bashrc.d/pa.bash
index 6c3531f0..3a7b8398 100644
--- a/bash/bashrc.d/pa.bash
+++ b/bash/bashrc.d/pa.bash
@@ -1,4 +1,4 @@
-# Print arguments
+# Print arguments, one per line. Compare pan().
pa() {
if (($#)) ; then
printf '%s\n' "$@"
diff --git a/bash/bashrc.d/pan.bash b/bash/bashrc.d/pan.bash
index 14cd3625..97de3917 100644
--- a/bash/bashrc.d/pan.bash
+++ b/bash/bashrc.d/pan.bash
@@ -1,6 +1,8 @@
# Print arguments, null-delimited; you will probably want to write this into a
-# file or as part of a pipeline
+# file or as part of a pipeline. Compare pa().
pan() {
- printf '%s\0' "$@"
+ if (($#)) ; then
+ printf '%s\0' "$@"
+ fi
}