From ae496a66afd692d166edcf239b5fdc2e3ed9a952 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 23 May 2024 15:47:50 +0200 Subject: [PATCH] cd_sed --- cd.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cd.sh b/cd.sh index fff9929..e8da6a4 100644 --- a/cd.sh +++ b/cd.sh @@ -620,14 +620,15 @@ cd_rm () { cd_sed () { local expression -local file - if [ -f "${1}" ] ; then - file="${1}" - shift - for expression in "${@}" ; do - sed --in-place "s${expression}g" "${file}" || exit - done +local file="${1}" +shift + if [ -f "${file}" ] ; then cd_cat "${file}" + for expression in "${@}" ; do + sed --in-place "s${expression}g" "${file}" \ + && cd_cat "${file}" \ + || exit + done fi }