diff --git a/tests/t0100-code-nobacktick.sh b/tests/t0100-code-nobacktick.sh new file mode 100755 index 0000000..6db16d6 --- /dev/null +++ b/tests/t0100-code-nobacktick.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +test_description='no old-style backtick command substitution + +This test checks the todo.sh script itself for occurrences +of old-style backtick command substitution, which should be +replaced with $(...). +' +. ./test-lib.sh + +test_todo_session 'no old-style backtick command substitution' <>> sed -n -e 's/[ \t]#.*//' -e '/\d96/{=;p}' "$(which todo.sh)" +EOF + +test_done diff --git a/todo.sh b/todo.sh index 0d7762a..54f2071 100755 --- a/todo.sh +++ b/todo.sh @@ -621,7 +621,7 @@ _addto() { if [[ $TODOTXT_DATE_ON_ADD = 1 ]]; then now=$(date '+%Y-%m-%d') - input=`echo "$input" | sed -e 's/^\(([A-Z]) \)\{0,1\}/\1'"$now /"` + input=$(echo "$input" | sed -e 's/^\(([A-Z]) \)\{0,1\}/\1'"$now /") fi echo "$input" >> "$file" if [ $TODOTXT_VERBOSE -gt 0 ]; then