看板 Linux 關於我們 聯絡資訊
cp -p dirA dirB > /tmp/log 2>&1 & 整段丟背景執行 cp -p dirA dirB & > /tmp/log 2>&1 前面丟背景執行,如有輸出再導向 哪個才是正確的作法呢? 這邊搞不是很懂 感謝 ---- Sent from BePTT on my iPhone 12 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 49.216.51.167 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1643122034.A.C45.html
Gold740716: 後面那個語法錯誤,丟到背景執行的 `&` 相當於 `;` , 01/26 13:35
Gold740716: `&` 後面的會被當作下一行指令執行 01/26 13:36