用管道的时候的问题

sh/bash/dash/ksh/zsh等Shell脚本
回复
nangergong
帖子: 103
注册时间: 2008-09-19 3:26

用管道的时候的问题

#1

帖子 nangergong » 2009-06-05 6:12

为何
用grep 的时候

代码: 全选

|grep   这后面不加 -



用paste的时候
|paste -
后面要加 -代表管道的输入?
头像
bones7456
帖子: 8495
注册时间: 2006-04-12 20:05
来自: 杭州
联系:

Re: 用管道的时候的问题

#2

帖子 bones7456 » 2009-06-05 8:24

因为有的程序默认从stdin读取数据,但有的程序默认从文件读取数据,只有文件名为"-"的时候,才从stdin读取.
关注我的blog: ε==3
回复