Redirection
来源:互联网 发布:带关闭漂浮js广告代码 编辑:程序博客网 时间:2024/04/29 14:40
Typically, the syntax of these characters is as follows, using <
to redirect input, and >
to redirect output.
command1 > file1
executes command1, placing the output in file1, as opposed to displaying it at the terminal, which is the usual destination for standard output. This will clobber any existing data in file1.
Using
command1 < file1
executes command1, with file1 as the source of input, as opposed to thekeyboard, which is the usual source for standard input.
command1 < infile > outfile
combines the two capabilities: command1 reads from infile and writes tooutfile
Variants[edit]
To append output to the end of the file, rather than clobbering it, use the>>
operator:
command1 >> file1
To read from a stream literal (an inline file, passed to the standard input), one can use a here document, using the <<
operator:
tr a-z A-Z << END_TEXTone two threeuno dos tresEND_TEXT
To read from a string, one can use a here string, using the <<<
operator:
tr a-z A-Z <<< "one two three"
or:
NUMBERS="one two three"tr a-z A-Z <<< "$NUMBERS"
- Redirection
- netwok redirection
- Redirection on input/output.
- Pipes, Lists & Redirection
- I/O Redirection Memo
- 图解Spice USB Redirection
- All about redirection
- I/O Redirection
- Advanced redirection features
- redirection in linux
- simple introduction for redirection
- Batch File Redirection
- 如何配置 IIS Redirection?
- Using file redirection
- Commands about IO Redirection
- Redirection When Session Times Out
- Chapter 20. I/O Redirection
- Standard Input and Output Redirection
- 【第七章】 对JDBC的支持 之 7.4 Spring提供的其它帮助 ——跟我学spring3
- 5.9.6UIImageView
- WebRTC中的NETEQ技术的研究
- U3D中的多线程
- VS2012编译器可不可以把堆内存改到4G
- Redirection
- Hadoop源码分析-Text
- CAKeyframeAnimation
- django 中模板遍历字典
- arcgis影像放大不显示、影像周围有大面积黑色等问题的处理
- 苹果iPhone6现在手机多少钱价
- 5.9.7UILoadingBar
- 第九周项目3——分数中的运算重载符(续)
- oracle 基本查询语句及实例