我在 Jenkins Execute shell 块中有一个如下编写的 bash 脚本
id="233"
Run Code Online (Sandbox Code Playgroud)
我想在以下命令中使用这个 id 变量
bash -c 'comm -12 <(sort file1_${id}.txt) <(sort file2_${id}.txt)'
Run Code Online (Sandbox Code Playgroud)
但它抛出错误
sort: cannot read: file1_.txt: No such file or directory
sort: cannot read: file2_.txt: No such file or directory
Run Code Online (Sandbox Code Playgroud)
我尝试了以下但没有运气,不知道如何解决
"$id"
"${id}"
'$id'
'${id}'
Run Code Online (Sandbox Code Playgroud)