From 17d22283f8bff393e91ff662a7f46147c468eb86 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 16:10:45 +0200 Subject: [PATCH] cd_cat --- cd.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index f15b989..5bec963 100644 --- a/cd.sh +++ b/cd.sh @@ -597,10 +597,11 @@ ${CD_PYTHON_PACKAGES}/${CD_GIT_CHILD}" # functions cd_cat () { - if [ -f "${1}" ] ; then - cd_open "${1}" - cat "${1}" || exit - cd_shut "${1}" + cd_cat__file="${1}" + if [ "${cd_cat__file}" ] ; then + cd_open "${cd_cat__file}" + cat "${cd_cat__file}" || exit + cd_shut "${cd_cat__file}" fi }