背景執行與輸出導向疑問 - Linux

Table of Contents

cp -p dirA dirB > /tmp/log 2>&1 &

整段丟背景執行



cp -p dirA dirB & > /tmp/log 2>&1

前面丟背景執行,如有輸出再導向

哪個才是正確的作法呢?

這邊搞不是很懂

感謝
----
Sent from BePTT on my iPhone 12

--

All Comments

Andy avatarAndy2022-01-30
後面那個語法錯誤,丟到背景執行的 `&` 相當於 `;` ,
Isla avatarIsla2022-02-04
`&` 後面的會被當作下一行指令執行