I have two issues. I am  trying to pass files through a pipe as an argument, and I am trying to use that file as a variable inside the sh function.Here is my command:find . -name 'segment*' | xargs -n1 -P4 sh someFunction.shHere, my line is finding all files that look like segment.something and passing it into the right side of the pipe. In someFunction.sh, I need the name of the file as an argument. Let's say the file being inputted in segment1.The someFunction.sh will print out every line of segment1 (for instance). How do I pass output from the left hand side of the pipe to the right hand side, and then how do I call it within someFunction.sh?
Pass input file through pipe as argument?
shell;find;pipe;xargs