From ddf226573ed20deda59030ad4664339eab3c3e5d Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Fri, 17 Mar 2023 11:17:27 +0530 Subject: dbook: preserve spacing of config file when using -d --- dbook | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dbook b/dbook index 3f7b693..487011e 100755 --- a/dbook +++ b/dbook @@ -99,7 +99,9 @@ rm_data() data= cl= file= + oid_ifs="$IFS" + IFS= while read -r line do cl="$line\n" @@ -130,10 +132,11 @@ rm_data() file="${file}${cl}" done < "$book_conf" + IFS="$old_ifs" # shellcheck disable=SC2059 printf "$file" > "$book_conf" - unset read_name data file cl + unset read_name data file cl old_ifs } entry() -- cgit v1.2.3