15.1 理解输入输出ide
在显示器屏幕上显示输出
将输出重定向到文件中blog
1只重定向错误
la badfile 2> test1
2重定向错误和数据
la test1 badfile 2> test2 1> test3
la test1 badfile &> test2接口
脚本中重定向(若是追加使用>>):
echo "error" >&2input
exec 0< input
exec 1> output
exec 2> error.outputit
建立本身的重定向:
exec 3> test.out
echo "test" >&3class
建立读写文件符号(要当心,不容易使用)
exec 3<> testfiletest
关闭文件描述符:
exec 3>&-date
建立临时文件/目录:
mktemp test.XXXXXX
mktemp -d test.dir.XXXXXXfile
管道的T型接口:
date | tee outputim