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

相关文章
相关标签/搜索