Fix 'too many arguments' error on org-capture

org-capture foo bar baz

will fail with:

org/capture: line 33: [: too many arguments

Adding quotes to the expansion of $str will ensure that test -z has
only one argument.
This commit is contained in:
pancho horrillo 2021-03-08 10:42:06 +01:00
parent cf44c43f41
commit 3861225f0b

View File

@ -30,7 +30,7 @@ shift $((OPTIND-1))
# use remaining args, else try stdin
str="$*"
if [ -z $str ]; then
if [ -z "$str" ]; then
str=$(cat)
fi