From bcfd5bf44246982504a0c3dd562e9f5a7897ecfe Mon Sep 17 00:00:00 2001 From: Kristoffer Ahl Date: Fri, 3 Sep 2021 11:04:50 +0200 Subject: [PATCH] Fixes for example "get env" command. --- examples/centry/commands/get.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/centry/commands/get.sh b/examples/centry/commands/get.sh index 7637183..f97954f 100644 --- a/examples/centry/commands/get.sh +++ b/examples/centry/commands/get.sh @@ -9,7 +9,8 @@ # centry.cmd[get:env].option[sanitize]/envName=SANITIZE_OUTPUT get:env() { local output - output="$(env | ${SORTED} | grep "${FILTER}")" + output="$(env | ${SORTED:-cat})" + [[ -n "${FILTER}" ]] && output="$(echo "${output:-}" | grep "${FILTER}")" if [[ ${SANITIZE_OUTPUT} == true ]]; then echo "${output}" | sed 's/\=.*$/=***/'