From 9658cc140573fa83d9844479eda304233d7b4c6c Mon Sep 17 00:00:00 2001 From: BarbUk Date: Wed, 23 May 2018 18:01:41 +0400 Subject: [PATCH] do not mangle space in while read line loop --- snippy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippy b/snippy index 5f6d7a1..c414661 100755 --- a/snippy +++ b/snippy @@ -60,7 +60,7 @@ MENU_ARGS=${DMENU_ARGS} # fetches a document and interprets bashsyntax in string (bashdown) templates # @param string - string with bash(down) syntax (usually surrounded by ' quotes instead of ") bashdown(){ - while read -r line; do + while IFS= read -r line; do line="$(eval "printf -- \"$( printf "%s" "$line" | sed 's/"/\\"/g')\"")"; echo -e "$line" done