myscript some.data > output # or grep -h foo *.data | sort -u | myscript > output