diff --git a/bin/hledger-dc b/bin/hledger-dc index 7ee5c9a3f..949b0f0b1 100755 --- a/bin/hledger-dc +++ b/bin/hledger-dc @@ -6,7 +6,7 @@ # If a posting begins with Dr, remove that. # If it begins with Cr and contains no number, remove that. # If it begins with Cr, remove that and add a minus sign before the next number, and if that leaves a double minus, cancel those out. -dc2sign() { sed -E -e 's/^(\s+)Dr\s+/\1/' -e 's/^(\s+)Cr\s+([^0-9]+)$/\1\2/' -e 's/^(\s+)Cr\s+([^0-9]+)([0-9])/\1\2-\3/' -e 's/--([0-9])/\1/'; } +dc2sign() { sed -E -e 's/^(\s+)Dr\s+/\1/i' -e 's/^(\s+)Cr\s+([^0-9]+)$/\1\2/i' -e 's/^(\s+)Cr\s+([^0-9]+)([0-9])/\1\2-\3/i' -e 's/--([0-9])/\1/'; } dc2sign <"$1" | hledger -f- "${@:2}"