From 42189dd17110fa5ebcdb743d3a450c1be8b53b84 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 19:18:32 +0200 Subject: [PATCH] cat,ls --- cd.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/cd.sh b/cd.sh index b9a54ac..b7b74cb 100644 --- a/cd.sh +++ b/cd.sh @@ -592,9 +592,6 @@ ${CD_GIT_CHILD} # functions -cd_box_more () { - echo "${CD_BOX_VERTICAL} ${@}" -} cd_box_open () { echo "${CD_BOX_DOWN}${CD_BOX_LEFT} ${@}" } @@ -603,9 +600,10 @@ cd_box_shut () { } cd_cat () { - if [ "${1}" ] ; then - echo "${CD_BOX_DOWN}${CD_BOX_LEFT}$(realpath "${1}")" + if [ -f "${1}" ] ; then + cd_box_open "${1}" cat "${1}" || exit + cd_box_shut "${1}" fi } @@ -654,12 +652,10 @@ local command="${1}" } cd_ls () { -local path if [ -d "${1}" ] ; then - path="$(realpath "${1}")" - cd_box_open "${split}" + cd_box_open "${1}" ls -a -l "${1}" || exit - cd_box_shut "${split}" + cd_box_shut "${1}" fi }