Suppose I have a bash shell script called Myscript.sh that need one argument as input.
But I want the content of the text file called text.txt to be that argument.
I have tried this but it does not work:
cat text.txt | ./Myscript.sh
Is there a way to do this?
-I {}(placeholder) splits the piped output (reading thattext.txtwithcat) - into as many arguments as there are lines in that file; so if there are 3 lines, thenMyscript.shwill be executed 3 times: one for every line (substituting{}argument placeholder) – retif Mar 27 '22 at 20:33