|
@@ -47,15 +47,19 @@ __expand_line() {
|
47
|
47
|
local line=$1 # line to process
|
48
|
48
|
local mname # macro name
|
49
|
49
|
local mvline # line of macro value
|
|
50
|
+ local xline # expanded line
|
|
51
|
+ xline=$line
|
50
|
52
|
for mname in "${!MacroMap[@]}"; do
|
51
|
53
|
if ! test "${line//$mname}" == "$line"; then
|
52
|
|
- while IFS= read -r mvline; do
|
53
|
|
- echo "${line//$mname/$mvline}"
|
54
|
|
- done <<<"${MacroMap[$mname]}"
|
55
|
|
- return 0
|
|
54
|
+ xline=$(
|
|
55
|
+ while IFS= read -r mvline; do
|
|
56
|
+ echo "${line//$mname/$mvline}"
|
|
57
|
+ done <<<"${MacroMap[$mname]}"
|
|
58
|
+ )
|
56
|
59
|
fi
|
|
60
|
+ line=$xline
|
57
|
61
|
done
|
58
|
|
- echo "$line"
|
|
62
|
+ echo "$xline"
|
59
|
63
|
return 1
|
60
|
64
|
}
|
61
|
65
|
|