Redirection
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_TEXT
one two three
uno dos tres
END_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的更多相关文章
- Web安全相关(三):开放重定向(Open Redirection)
简介 那些通过请求(如查询字符串和表单数据)指定重定向URL的Web程序可能会被篡改,而把用户重定向到外部的恶意URL.这种篡改就被称为开发重定向攻击. 场景分析 假设有一个正规网站http:// ...
- 当nginx 500 伪静态错误时,记录解决方法rewrite or internal redirection cycle while processing
错误日志::rewrite or internal redirection cycle while processing "/index.php/index.php/index.php/in ...
- 3xx Redirection
3xx Redirection This class of status code indicates the client must take additional action to comple ...
- Advanced redirection features
here are three types of I/O, which each have their own identifier, called a file descriptor: standar ...
- Dynamic-Link Library Redirection
Dynamic-Link Library Redirection Applications can depend on a specific version of a shared DLL and s ...
- PLT redirection through shared object injection into a running process
PLT redirection through shared object injection into a running process
- Web安全相关(三):开放重定向(Open Redirection)
简介 那些通过请求(如查询字符串和表单数据)指定重定向URL的Web程序可能会被篡改,而把用户重定向到外部的恶意URL.这种篡改就被称为开发重定向攻击. 场景分析 假设有一个正规网站http://ne ...
- ATL项目编译注册dll的时候报权限错误:error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.
atl工程在vs2013编译的时候会在编译成功之后去使用 regsvr32 去注册 生成的 .dll 偶尔在编译的时候会遇到下面的错误: error MSB8011: Failed to regist ...
- rewrite or internal redirection cycle while processing nginx重定向报错
2018/05/07 15:03:42 [error] 762#0: *3 rewrite or internal redirection cycle while processing "/ ...
- Linux之IO Redirection
一.引言 前几天使用一个linux下的内存检测工具valgrind,想要把检测的结果重定向到文件,结果总是没有任何内容,最后才发现是重定向的原因,它输出的信息是输出到stderr的,所以我使用 > ...
随机推荐
- 解决weblogic 部署环境后出现的乱码问题
1.在startWebloci.cmd 中 set CLASSPATH=%SAVE_CLASSPATH% 下增加一行 JAVA_OPTIONS="${JAVA_OPTIONS} -Dfile ...
- 包建强的培训课程(13):iOS与ReactNative
@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...
- Java的BIO,NIO和AIO的区别于演进
作者:公众号:我是攻城师 前言 Java里面的IO模型种类较多,主要包括BIO,NIO和AIO,每个IO模型都有不一样的地方,那么这些IO模型是如何演变呢,底层的原理又是怎样的呢? 本文我们就来聊聊. ...
- SpringBoot 通过 Exploded Archives 的方式部署
之前部署 SpringBoot 一直是用可执行 jar 的方式. java -jar codergroup-1.0.0.jar 就可以启动项目,为了能在后台运行,通常我们会使用这行命令 nohup j ...
- 5.AutoCompleteTextView、自定义广播
新建信息 布局:自动出来的是系统的组件,里面是listview,写ontextchanglis也行 <LinearLayout xmlns:android="http://schema ...
- Excel 斜线表头制作方法
Excel 斜线表头制作方法
- Retrofit2 完全解析 探索与okhttp之间的关系
转载请标明出处: http://blog.csdn.net/lmj623565791/article/details/51304204: 本文出自:[张鸿洋的博客] 之前写了个okhttputils的 ...
- Java核心技术及面试指南 键值对方面的面试题总结以及答案
3.3.5.1如何遍历HashMap对象?尤其请说明通过Iterator遍历HashMap对象的方法. 建议用这种方式: Set<Entry<String,String>>en ...
- mybatis框架(3)---SqlMapConfig.xml解析
SqlMapConfig.xml SqlMapConfig.xml是Mybatis的全局配置参数,关于他的具体用的有专门的MyBatis - API文档,这里面讲的非常清楚,所以我这里就挑几个讲下: ...
- 网站 HTTP 升级 HTTPS 完全配置手册
网站 HTTP 升级 HTTPS 完全配置手册 今天,所有使用Google Chrome稳定版的用户迎来了v68正式版首个版本的发布,详细版本号为v68.0.3440.75,上一个正式版v67.0.3 ...