Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 在BASH中,哪种方法是将输出写入和读取到文件中的好方法?_Linux_Unix - Fatal编程技术网

Linux 在BASH中,哪种方法是将输出写入和读取到文件中的好方法?

Linux 在BASH中,哪种方法是将输出写入和读取到文件中的好方法?,linux,unix,Linux,Unix,要将输出写入文件,我遇到了三种方法。我可以知道选择哪一个更好,以及如何选择 1) echo "some outputs" >> file.out 2) exec 3<> file.out echo "some Outputs" >&3 exec 3<-& 3) echo "some outputs" | tee file.out 1)回显“某些输出”>>file.out 2) exec 3 file.out 回显“某些输出”>&3

要将输出写入文件,我遇到了三种方法。我可以知道选择哪一个更好,以及如何选择

1) echo "some outputs" >> file.out
2) exec 3<> file.out
   echo "some Outputs" >&3
   exec 3<-&
3) echo "some outputs" | tee file.out
1)回显“某些输出”>>file.out
2) exec 3 file.out
回显“某些输出”>&3

exec 3>,是否每个进程都采用不同的进程?-这意味着什么?对不起,每个命令都需要单独的过程??
Q1) How an Command works, Is it an complied code or "C" program or assembly code?
Q2) Is every Command takes different process?
Q3) What is the process behind re directors(<,>, >>,<< )?