From c033e89f58d2e1c1145e28740d41960d85ebabe3 Mon Sep 17 00:00:00 2001 From: Linux User Date: Sat, 7 Nov 2020 23:06:26 +0000 Subject: [PATCH] escape newlines --- add_todo.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/add_todo.sh b/add_todo.sh index bab430d..317a553 100755 --- a/add_todo.sh +++ b/add_todo.sh @@ -12,7 +12,8 @@ if [ -z "$_api_auth" ] ; then fi _title="$1" -_description="$2" +# remove newlines (https://stackoverflow.com/a/38672741/1885932) +_description="$(echo "$2" | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')" _api_url='http://kanboard.docker.home/jsonrpc.php' _project_id=4