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. Android-获取Html元素

    第一步导包: implementation 'org.jsoup:jsoup:1.10.3' 第二步:需获取解析的Html: <p> <myfont style="colo ...

  2. DevOps最佳工具集实践

    在列出DevOps 工具链之前,介绍一下什么是DevOps,虽然DevOps这个概念现在还没有标准的定义,但我们可以追溯一下其过去九年的历史发展过程(从2009年-2017年),列出几个相对明确又有所 ...

  3. jquery mobile Touch事件

    Touch事件在用户触摸屏幕(页面)时触发 1.jquery mobile tap tap事件在用户敲击某个元素时触发 $("p").on("tap",fucn ...

  4. W3bsafe]SQLmap过狗命令的利用+教程

    W3bsafe]SQLmap过狗命令的利用+教程 本文转自:i春秋社区 我就是那个爱装逼的小人   本屌又来装逼了 SQLmap注入的时候 有的肯定会被安全狗拦截吧 本屌来教各位过狗!过waf等安全狗 ...

  5. STL::sort函数实现

    声明:本文参考链接:STL::sort实现. 排序是面试中经常被问及的算法基础知识点,虽然实际应用中不会直接使用,但是理解这些简单的算法知识对于更复杂更实用的算法有一定的帮助,毕竟面试总不能问的太过深 ...

  6. ASP.NET Core 2.1 使用Docker运行

    重要提示,本文为 ASP.NET Core 2.1 如果你是 2.2 那么请将文中的镜像换为 microsoft/dotnet:2.2.0-aspnetcore-runtime 即可,其他操作一样 1 ...

  7. ③JSP经典回顾

    jsp概述 jsp实际就是一个高级servlet,比servlet容易很多.jsp/servlet在jsp容器中运行.例如,Tomcat就是一个Servlet/jsp容器. 关于tomcat:[传送门 ...

  8. 图片预览(适用于IE6,9,10,Firefox)

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...

  9. Apache-Flink深度解析-概述

    摘要: Apache Flink 的命脉 "命脉" 即生命与血脉,常喻极为重要的事物.系列的首篇,首篇的首段不聊Apache Flink的历史,不聊Apache Flink的架构, ...

  10. PHP实现螺旋矩阵(螺旋数组)

    今天碰到一个比较有意思的问题, 就是把A到Y这25个字母以下面的形式输出出来 A B C D E P Q R S F O X Y T G N W V U H M L K J I 问题很有意思,就是转圈 ...