0
A
回答
5
With cat < file
,cat
从其标准输入读取; shell会打开文件并将文件句柄连接到cat
。与cat file
,cat
本身打开文件没有任何shell介入。两者的最终结果确实相同:cat
读取file
的内容并将它们输出到标准输出。
+0
尼斯和准确,但我敢打赌,这一定是已经被问及在这里回答。 – GhostCat
+0
值得一提的是,这是特定于'cat'命令的行为;其他一些命令的行为方式相同。 –
相关问题
- 1. cat file | ... vs ... <文件
- 2. perl中的foreach x(cat file)?
- 3. file .git和directory .git有什么区别?
- 4. git config --list和cat .gitconfig有什么区别?
- 5. 包含“file.h”与<file>有什么区别?
- 6. $ request-> file-> store($ path)和$ request-> file-> move($ path,$ filename)有什么区别?
- 7. 在“while read -r line; do ...; done <file`和`cat file | while IFS = read -r line; do ...; done`之间bash之间有任何区别吗?
- 8. 在IE中,File-> Save As和document.execCommand('SaveAs')有什么区别?
- 9. C#中的File和FileInfo有什么区别?
- 10. save-hook-hook和write-file-function之间有什么区别
- 11. emacs中'M-x load-file'和'M-x load-library'有什么区别?
- 12. 运行scala时出现“cat:/ release:No such file or directory”
- 13. BASH,cat缓冲区
- 14. 为什么不使用<< EOF代替cat << EOF?
- 15. URL“file://”和“http://”之间的区别是什么
- 16. “./file”名称和“../文件名”之间的区别是什么
- 17. 排序和计数的方法比cat file |更快排序| uniq -c
- 18. File和Project之间的区别
- 19. file:// android_assets /和http://someurl.com/之间的区别?
- 20. 相当于“hg cat”或“svn cat”的git
- 21. file:/,file://,file:///
- 22. <?有什么区别? echo __();和<= __();
- 23. <%# %>和<%= %>有什么区别?
- 24. Spring MVC控制器:“return forward”,“return redirect”和“return jsp file”有什么区别
- 25. 将cat-art.php更改为cat/art.php
- 26. cat文件的linenumbers之间的区别| nl和wc -l文件
- 27. 当使用'git cat-file -p'时子模块提交对象'Not a valid object name'
- 28. <a href="http://file://///> convert file:// to file// ---remove colon
- 29. 为什么不是“ls $(pwd/cat)”工作?
- 30. zsh中`cat <( - )`返回哪个目录?
建议通过http://wiki.bash-hackers.org/howto/redirection_tutorial – Sundeep