1.介绍IO重定向用于捕捉一个文件,命令,程序,脚本或者代码块的输出,然后把捕捉到的输出作为输入发送给另外一个文件,命令,程序或脚本。终端程序一般从单一源以流的形式聚集输入和显示输出,script执行时(进程),系统会默认开启3个标准文件,stdin,stdout,stderr.script默认会..
分类:
其他好文 时间:
2015-01-03 08:14:14
阅读次数:
334
1.1相关命令编写脚本过程中主要使用两个命令useradd和passwd,可是使用man命令查看帮助。manpasswd
--stdin
Thisoptionisusedtoindicatethatpasswdshouldreadthenewpasswordfromstandardinput,whichcanbeapipe.
#可以使用标准输入的方式获取用户的新密码,且可以使用管道命令。..
分类:
系统相关 时间:
2015-01-02 16:16:01
阅读次数:
281
[root@www ~]# sort [-fbMnrtuk] [file or stdin]选项与参数:-f :忽略大小写的差异,例如 A 与 a 视为编码相同;-b :忽略最前面的空格符部分;-M :以月份的名字来排序,例如 JAN, DEC 等等的排序方法;-n :使用『纯数字』进行排序...
分类:
系统相关 时间:
2014-12-31 11:12:50
阅读次数:
223
相信在Linux下对文件操作经常会用到sort和uniq命令,下面系统的介绍一下这两个命令的用法。 sort命令是在Linux里非常有用,它将文件进行排序,并将排序结果标准输出。sort命令既可以从特定的文件,也可以从stdin中获取输入。 语法 sort(选项)(参数) 选项 -b:...
分类:
编程语言 时间:
2014-12-30 18:55:27
阅读次数:
258
import fileinputimport sysfor line in fileinput.input(): if fileinput.isstdin(): print 'file from stdin' #是否文件来自sys.stdin, cat file1|python xxx.py ...
分类:
其他好文 时间:
2014-12-30 13:14:54
阅读次数:
144
1)fflush编译器规定,fflush用于刷新输出流,对于输入流没有规定,也就是说 fflush(stdin) 的结果是未知的。这也就是在 VC下写C程序时,fflush(stdin)有效,VC下写C++程序时,fflush(stdin)无效的原因。2)VC下写C++程序时,清空缓存使用 clea...
分类:
其他好文 时间:
2014-12-30 00:27:33
阅读次数:
249
#! /usr/bin/perluse strict;use utf8;binmode(STDIN,":encoding(utf8)");binmode(STDERR,":encoding(utf8)");binmode(STDOUT,":encoding(utf8)");&extend("/hom...
分类:
其他好文 时间:
2014-12-28 23:26:46
阅读次数:
235
程序2-7 略去程序2-8 1 #define LOCAL 2 #include 3 #define INF 100000000 4 int main() 5 { 6 #ifdef LOCAL 7 freopen("data.in","r",stdin); 8 freope...
分类:
编程语言 时间:
2014-12-28 14:05:16
阅读次数:
184
1.预备知识
标准输入(stdin)、标准输出(stdout)和标准错误(stderr)是编写脚本的时候经常使用的,因为输出的信息可能是上述的一种。
文件描述符 是与打开的某个文件或者数据流相关联的整数。文件描述符0,1,2是系统预留的。
0 - stdin(标准输入)1 - stdout(标准输出)2 - stderr(标准错误)
2.实例
echo This is a...
分类:
系统相关 时间:
2014-12-28 11:43:07
阅读次数:
268
做Android 3年,对网络不是很关注,现在再看让我吃一惊,很多以前期望的功能都开源了,而且功能强大,就试用了一下。
简单试用
下载elasticsearch-1.4.2并启动
下载logstash-1.4.2, 运行下面的命令
bin/logstash -e 'input { stdin { } } output { elasticsearch { host => localhos...
分类:
其他好文 时间:
2014-12-26 16:44:53
阅读次数:
230