开发者

transferring via pipeline

开发者 https://www.devze.com 2023-01-01 13:49 出处:网络
I need to transfer data via pipe and also transfer file with this data, can I do something like this inside the script?

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

精彩评论

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