From 99bdbf05d23492d7d65f773528dc2b0abb40b04f Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Mon, 19 Oct 2020 22:02:43 +0100 Subject: [PATCH] pcat: allow commands with spaces on arguments Signed-off-by: Alejandro Mery --- files/bin/pcat | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/files/bin/pcat b/files/bin/pcat index 4802397..6347de7 100755 --- a/files/bin/pcat +++ b/files/bin/pcat @@ -141,8 +141,7 @@ done # compose pipeline # -# CMD -PIPELINE="$*" +PIPELINE= # FROM/UNTIL FILTER if [ -n "${FROM:-}${UNTIL:-}" ]; then @@ -163,4 +162,10 @@ if [ -n "${SED_ARGS:-}" ]; then fi #and run -eval "${PIPELINE:-cat}" +if [ $# -eq 0 ]; then + eval "${PIPELINE:-cat}" +elif [ -n "$PIPELINE" ]; then + "$@" | $PIPELINE +else + "$@" +fi