0

我有一个简单的脚本,但由于某种原因,将命令作为变量运行时它会失败。关于为什么的任何想法?(我正在尝试使用脚本更改 pipewire 的设备设置)

cmd2="pactl set-card-profile 'bluez_card.B8_F8_BE_79_40_C0' 'headset-head-unit-msbc'"
$cmd2  
#Command above Fails with "Failure: No such entity"

pactl set-card-profile 'bluez_card.B8_F8_BE_79_40_C0' 'headset-head-unit-msbc'
#command above works fine. (if I modify the bluez to blue99 it fails as cmd2 did)
4

1 回答 1

0

不知道为什么这有效..但删除 ' 修复它..

cmd2="pactl set-card-profile bluez_card.B8_F8_BE_79_40_C0 headset-head-unit-msbc"
$cmd2
于 2021-09-30T15:36:05.103 回答