From d9d339e15713e62e637f06511e9da83d009530fd Mon Sep 17 00:00:00 2001 From: remittor Date: Sun, 27 Apr 2025 22:06:59 +0300 Subject: [PATCH] comfunc: Fix stdout into func adapt_for_sed --- zapret/comfunc.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zapret/comfunc.sh b/zapret/comfunc.sh index d75b2ff..c3651f9 100755 --- a/zapret/comfunc.sh +++ b/zapret/comfunc.sh @@ -21,8 +21,7 @@ CRONTAB_FILE="/etc/crontabs/root" function adapt_for_sed { - local str=$( ( echo $1|sed -r 's/([\$\.\*\/\[\\^])/\\\1/g'|sed 's/[]]/\\]/g' )>&1 ) - echo "$str" + echo -n "$1" | tr '\r' ' ' | tr '\n' ' ' | tr '\t' ' ' | sed -r 's/([\$\.\*\/\[\\^])/\\\1/g' | sed 's/[]]/\\]/g' } function is_valid_config