I have a config file in JSON format with following block

```
"device" :
{
    "name"       : "MyPi",
    "type"       : "ws2801",
    "output"     : "/dev/spidev0.0",
    "rate"       : 250000,
    "colorOrder" : "rgb"
},

```

I use sed (non GNU version on OS X) to replace the string values with sed expression like this:
`sed -i '' '1h;1!H;$!d;x;s#\("device" :[^}]*"colorOrder"[ ]*: \)"[^"]*"#\1"grb"#' hyperion.config.json`

Now I want to replace "output": line with the result of `ls /dev/tty.usbmodem*` with this command:
`sed -i '' -e '1h;1!H;$!d;x;s#\("device" :[^}]*"output"[ ]*: \)"[^"]*"#\1"$(ls /dev/tty.usbmodem*)"#' hyperion.config.json`
However `ls` is not executed and I get `"output" : "$(ls /dev/tty.usbmodem*)",`
I tried replacing single quotes with double quotes with escaping inside the expression, that didn't work.

So how can I replace the value of the output (inside the "device" block) with the output of `ls` command?