开发者

transferring via pipeline

I need to transfer data via pipe and also transfer file with this data, can I do something like this inside the script?

cat ${1} | ./he开发者_如何学Clper ${1}

and what is the difference if I write

cat ${1} | ./helper < ${1}


"<" adds the file content to your scripts stdin

pipe also redirects the output for stdin of the ./helper script

you could eithe do cat ${1} | ./helper or ./helper < ${1} assuming ${1} is a filename and in helper script access it from /dev/stdin

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜