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的,所以我使用 > ...
随机推荐
- java,让debug出色
虽然我们不喜欢bug,但是bug永远都存在.虽然我们牛逼,但是仍然有不知道的东西,解决不了的问题.so,还得借助工具,让咱效率提起来扛扛的.解决的问题如是:由于某种原因,其他系统发送的mq,我这边说没 ...
- Python 22端口发邮件
#!/usr/bin/python#-*-coding:UTF-8-*- import smtplibimport timeimport os from email.mime.text import ...
- android自动化必备之界面元素
包名&类名 packageName(包名) 应用的身份标识,系统通过包名识别不同的应用,如两个相同包名的应用在安装时候会覆盖 activityName(类名) Activity:android ...
- ALL_DB_LINKS
类型:View Owner:SYS 内容:记录了当前用户下可访问的所有的DB links 字段: OWNER : DB Link的owner DB_LINK : DB Link名称 USERNAME ...
- Elasticsearch基础教程分享
基础及相关资料 首先我们先了解一下什么是Elastisearch,Elasticsearch(简称es)是一个基于Lucene库的搜索引擎.它提供了一个分布式.支持多租户的全文搜索引擎,具有HTTP ...
- c# json 序列化如何去掉null值
要将一个对象序列化,可是如果对象的属性为null的时候,我们想将属性为null的都去掉. 在这里我使用Newtonsoft.Json.dll 记录一下序列化以及反序列化 json字符串转对象 Mode ...
- 编写高质量代码改善java程序的151个建议——[1-3]基础?亦是基础
原创地址: http://www.cnblogs.com/Alandre/ (泥沙砖瓦浆木匠),需要转载的,保留下! Thanks The reasonable man adapts himse ...
- shiro 获取请求头中的 rememberMe
前言: 上一篇提到了, 将 sessionId 放到请求头中去, 那rememberMe是否也可以放到请求头中去呢. 其实不管是sessionId还是rememberMe, shiro都会默认往coo ...
- Docker 简述
转自:https://cloud.tencent.com/developer/article/1354393 虚拟机和 docker 的区别,如下图: Image (镜像) 镜像不包含任何动态数据,其 ...
- Linux软件包管理之yum在线管理
目录 1.yum在线管理 2.网络 yum 源 3.光盘 yum 源搭建步骤 ①.挂载光盘 ②.让网络 yum 源失效 ③.修改光盘yum源文件 ④.输入yum list 可以查看光盘yum源里面的软 ...