From a635d175cefd4ade6d76e74a57bbbb01023971a3 Mon Sep 17 00:00:00 2001 From: albfan Date: Sat, 16 May 2015 20:36:17 +0200 Subject: [PATCH] clear function --- bash-ini-parser | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bash-ini-parser b/bash-ini-parser index 1d736dc..adc9bc0 100644 --- a/bash-ini-parser +++ b/bash-ini-parser @@ -94,6 +94,18 @@ function cfg_writer { IFS="$OLDIFS" } +function cfg_clear { + OLDIFS="$IFS" + IFS=' '$'\n' + fun="$(declare -F)" + fun="${fun//declare -f/}" + for f in $fun; do + [ "${f#$PREFIX}" == "${f}" ] && continue + unset -f ${f} + done + IFS="$OLDIFS" +} + function cfg_update { SECTION=$1 VAR=$2