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的更多相关文章

  1. Web安全相关(三):开放重定向(Open Redirection)

    简介 那些通过请求(如查询字符串和表单数据)指定重定向URL的Web程序可能会被篡改,而把用户重定向到外部的恶意URL.这种篡改就被称为开发重定向攻击.   场景分析 假设有一个正规网站http:// ...

  2. 当nginx 500 伪静态错误时,记录解决方法rewrite or internal redirection cycle while processing

    错误日志::rewrite or internal redirection cycle while processing "/index.php/index.php/index.php/in ...

  3. 3xx Redirection

    3xx Redirection This class of status code indicates the client must take additional action to comple ...

  4. Advanced redirection features

    here are three types of I/O, which each have their own identifier, called a file descriptor: standar ...

  5. Dynamic-Link Library Redirection

    Dynamic-Link Library Redirection Applications can depend on a specific version of a shared DLL and s ...

  6. PLT redirection through shared object injection into a running process

    PLT redirection through shared object injection into a running process

  7. Web安全相关(三):开放重定向(Open Redirection)

    简介 那些通过请求(如查询字符串和表单数据)指定重定向URL的Web程序可能会被篡改,而把用户重定向到外部的恶意URL.这种篡改就被称为开发重定向攻击. 场景分析 假设有一个正规网站http://ne ...

  8. 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 ...

  9. 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 "/ ...

  10. Linux之IO Redirection

    一.引言 前几天使用一个linux下的内存检测工具valgrind,想要把检测的结果重定向到文件,结果总是没有任何内容,最后才发现是重定向的原因,它输出的信息是输出到stderr的,所以我使用 > ...

随机推荐

  1. struts2 简单注解配置代替xml配置文件

    1. 主要文件 LoginAction.javapackage com.edu.struts2.action;import org.apache.struts2.convention.annotati ...

  2. 【redux】详解react/redux的服务端渲染:页面性能与SEO

        亟待解决的疑问 为什么服务端渲染首屏渲染快?(对比客户端首屏渲染)   react客户端渲染的一大痛点就是首屏渲染速度慢问题,因为react是一个单页面应用,大多数的资源需要在首次渲染前就加载 ...

  3. Spring Boot 主类及目录结构介绍

    Spring Boot 与传统项目最大的区别是,传统项目都是打成 WAR 包部署到服务器上面,需要额外的 Servlet 容器, 而 Spring Boot 则可以直接打成 jar 包,并内置集成了 ...

  4. 两步验证杀手锏:Java 接入 Google 身份验证器实战

    两步验证 大家应该对两步验证都熟悉吧?如苹果有自带的两步验证策略,防止用户账号密码被盗而锁定手机进行敲诈,这种例子屡见不鲜,所以苹果都建议大家开启两步验证的. Google 的身份验证器一般也是用于登 ...

  5. JS中部分不常用小功能记录

    1.serializeArray()在表单中使用,必须在form标签中,需要手机的元素要有name属性.源生JS将对象转成json   resulrMK = JSON.stringify(resulr ...

  6. hbase之createTable完整的netty实现执行流程

    hbase的客户端代码并不想hive一样用java编写,shell调用,而是使用ruby编写. 在admin.rb文件中方法create,其中接受两个参数,其中第二个参数类型为变长参数. 而在crea ...

  7. JavaScript优化细节(一)

    1.置空Closure(闭包)引起的Memory leak滞留的Object和domain 2.用fragment实现append大量元素 var f= document.createDocument ...

  8. Vue 项目 Vue + restfulframework

    Vue 项目 Vue + restfulframework 实现登录认证 - django views class MyResponse(): def __init__(self): self.sta ...

  9. mysql 开发基础系列10 存储引擎 InnoDB 介绍

    一. 概述: InnoDB存储引擎提供了具有提交,回滚,和崩溃恢复能力的事务安全,对比MYISAM 的存储引擎,InnoDB写的处理效率差一些并且会占用更多的磁盘空间以保留数据和索引.它的特点有如下: ...

  10. 【EF6学习笔记】(十二)EF高级应用场景

    本篇原文链接:Advanced Entity Framework Scenarios 本篇主要讲一些使用Code First建立ASP.NET WEB应用的时候除了基础的方式以外的一些扩展方式方法: ...