先總結一個表: linux
exec命令 shell |
做用 spa |
exec ls table |
在shell中執行ls,ls結束後不返回原來的shell中了 file |
exec <file im |
將file中的內容做爲exec的標準輸入 d3 |
exec >file 總結 |
將file中的內容做爲標準寫出 sort |
exec 3<file tab |
將file讀入到fd3中 |
sort <&3 |
fd3中讀入的內容被分類 |
exec 4>file |
將寫入fd4中的內容寫入file中 |
ls >&4 |
Ls將不會有顯示,直接寫入fd4中了,即上面的file中 |
exec 5<&4 |
建立fd4的拷貝fd5 |
exec 3<&- |
關閉fd3 |