findword $1 | findword $2 < testfile.txt
But obviously this only works for 2 arguments. We''ve also got:
for i
do
findowrd $1 < testfile.txt
done
But this will print all the lines containing $1, followed by all the lines containing $2. What we need is some way to pipe the output of the previous loop to the input of the current loop.
Any ideas?