讀取檔案並替換行的 Shell 腳本 2024-6-29 • scripts 我需要協助建立一個 shell 腳本來.yml在特定資料夾中搜尋檔案中包含的行money:,然後將該行替換為money: 1000 答案1 你可以嘗試sed。例如: sed -i 's/\(.*money:.*\)/money: 1000/g' somefile.yml 相關內容