linux exec 文件重定向

linux exec用法總結

先總結一個表: linux

exec命令 shell

做用 spa

exec ls table

shell中執行lsls結束後不返回原來的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

相關文章
相關標籤/搜索