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的,所以我使用 > ...
随机推荐
- Windows 10 IoT Core 17093 for Insider 版本更新
新特性: General bug fixes Enabled Miracast on Dragonboard. 已知的一些问题: F5 driver deployment from Visual ...
- Ubuntu18.04版本设置root账户
Linux系统下文件的权限十分重要,大多数操作都需要一定的权限才可以操作,Ubuntu18.04默认安装是没有设置root账户的,因此想要获得root账户登录可以使用以下步骤: 1.首先获得临时的 ...
- 解决微信小程序登录与发布的一些问题
解决微信小程序的问题 图片在电脑上显示但在手机上却无法显示的问题 要使用的是本地图片,不想把图片上传到网络再通过https的方式解决,解决方法如下: 1.image src中的图片地址对英文字母大小写 ...
- ruby-super用法
ruby语法-super用法 本文主要介绍ruby中super方法的使用.super方法参数传递.method执行顺序. 下面主要通过实例来说明super方法的使用: 示例1: #!/usr/bin/ ...
- 使用本地缓存快还是使用redis缓存好?
使用本地缓存快还是使用redis缓存好? Redis早已家喻户晓,其性能自不必多说. 但是总有些时候,我们想把性能再提升一点,想着redis是个远程服务,性能也许不够,于是想用本地缓存试试!想法是不错 ...
- lua模块demo(redis,http,mysql,cjson,本地缓存)
1. lua模块demo(redis,http,mysql,cjson,本地缓存) 1.1. 配置 在nginx.conf中设置lua_shared_dict my_cache 128m; 开启ngi ...
- 从TXT文本文档向Sql Server中批量导入数据
下面我们通过以下的简单的SQL语句即可实现数据的批量导入,代码如下: Bulk insert id From 'G:\文档\test.txt' With ( fieldterminator=',', ...
- jQuery实现遮罩层
1.1 背景半透明遮罩层样式 需要一个黑色(当然也可以其他)背景,且须设置为绝对定位,以下是项目中用到的css样式: /* 半透明的遮罩层 */ #overlay { background: #000 ...
- GITHUB(github)初级使用
Github顾名思义是一个Git版本库的托管服务,是目前全球最大的软件仓库,拥有上百万的开发者用户,也是软件开发和寻找资源的最佳途径,Github不仅可以托管各种Git版本仓库,还拥有了更美观的Web ...
- GIT的初级使用
安装git [root@localhost ~]# yum -y install git [root@localhost ~]# git --version git version 1.8.3.1 初 ...