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
精彩评论