From 766d26825637276d0e1e0fb7061a75c0c445a375 Mon Sep 17 00:00:00 2001 From: Mikhail Titov Date: Mon, 13 May 2024 16:39:26 -0400 Subject: [PATCH] updated `expr` usage for env funcs extraction --- bin/radical-utils-env.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/radical-utils-env.sh b/bin/radical-utils-env.sh index 6da22fda..33e342aa 100755 --- a/bin/radical-utils-env.sh +++ b/bin/radical-utils-env.sh @@ -215,8 +215,9 @@ env_prep(){ # handle bash function definitions v=$(grep -e "^$k=" $src | cut -f 2- -d= | sed -e 's/{ /{\n/') - func=$(expr "$k" : '^BASH_FUNC_\(.*\)\(()\|%%\)$') - if ! test -z "$func" + func=$(expr "$k" : '^BASH_FUNC_\(.*\)()$' \ + \| "$k" : '^BASH_FUNC_\(.*\)%%$') + if ! test -z "$func" && ! test "$func" = 0 then functions="$func $v\nexport -f $func\n\n$functions" else