Bash命令中單引號中變量的擴展我想從Bash shell腳本它在單引號和變量中有單引號和一些其他命令。G.repo forall -c '....$variable'以這種格式,$轉義,并且變量未展開。我嘗試了以下幾種變體,但都被拒絕了:repo forall -c '...."$variable" 'repo forall -c " '....$variable' "" repo forall -c '....$variable' "repo forall -c "'" ....$variable "'"如果我替換變量的值,那么命令就會執行得很好。請告訴我哪里出了問題。
3 回答

largeQ
TA貢獻2039條經驗 獲得超8個贊
- 3 回答
- 0 關注
- 665 瀏覽
添加回答
舉報
0/150
提交
取消