From ab5010651d679e1d01093c5b6eea4cb99f5d2d36 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 2 Jul 2016 00:06:59 +1200 Subject: Terser pa/paz implementations --- bash/bashrc.d/pa.bash | 5 ++--- bash/bashrc.d/paz.bash | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'bash') diff --git a/bash/bashrc.d/pa.bash b/bash/bashrc.d/pa.bash index 5f963818..b47189bf 100644 --- a/bash/bashrc.d/pa.bash +++ b/bash/bashrc.d/pa.bash @@ -1,6 +1,5 @@ # Print arguments, one per line. Compare paz(). pa() { - if (($#)) ; then - printf '%s\n' "$@" - fi + (($#)) || return 0 + printf '%s\n' "$@" } diff --git a/bash/bashrc.d/paz.bash b/bash/bashrc.d/paz.bash index def70f8d..77299dad 100644 --- a/bash/bashrc.d/paz.bash +++ b/bash/bashrc.d/paz.bash @@ -1,7 +1,6 @@ # Print arguments, null-delimited; you will probably want to write this into a # file or as part of a pipeline. Compare pa(). paz() { - if (($#)) ; then - printf '%s\0' "$@" - fi + (($#)) || return 0 + printf '%s\0' "$@" } -- cgit v1.2.3