先总结一个表: 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 |