0

I get an error when using "dconf write" to value a key with a [] list from a bash shell script

The script below works as expected :

#!/bin/bash
echo "dconf write <PATH> \"['val1','val2']\""
dconf write <PATH> "['val1','val2']"
dconf read <PATH>
echo OK

The script below fails with "error: 0-9:unterminated string constant"

#!/bin/bash
list="\"['val1','val2']\""
echo dconf write <PATH> $list
dconf write <PATH> $list                #fail
dconf read <PATH>
echo NOK

any idea ?

0

1 Answer 1

3

The OP posted a solution in his question:

1st solution:

dconf write <PATH> "$list"              #ok

2nd solution:

eval dconf write <PATH> $list           #ok

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .