To clarify holo's response, <> will read from STDIN only when all the files on the commandline have been exausted. In scripts without arguments, this will always read from STDIN. But since your script takes arguments, it won't DWIM (at least, not right away...)