Update to v2.2:

New: Allow for the value of other entries to be in the 'sed' command of a
       filter. (May break existing configurations in cases where sed command
       uses a '%'.)
This commit is contained in:
2023-03-21 20:13:35 -04:00
parent aacbf51475
commit 70bba87946
6 changed files with 16 additions and 9 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
## Copyright Ian Jauslin 2015-2022
## Copyright Ian Jauslin 2015-2023
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
@ -18,7 +18,7 @@
enginedir=/usr/share/BBlog/engines
# version
version=2.1.5
version=2.2
function print_config {
echo "engine: $engine"
@ -222,7 +222,8 @@ function replace_format {
# apply filter
if [ -n "$filter" ]; then
sed_cmd=$(eval "echo \$filter_$filter")
# replace '%' inside filter text
sed_cmd=$(replace_format $(eval "echo \$filter_$filter"))
replacement=$(eval "echo \$$field" | sed -r "$sed_cmd" )
else
replacement=$(eval "echo \$$field")